Board index » delphi » Report's Preview "Access Violation"?

Report's Preview "Access Violation"?

Hi all.

I'm using Delphi 5 Enterprise, MS Access 97 ( with BDE ) and
Quick Report 3.5.

I want to Preview a report, that the name is stored on a
database's table.

On this moment, I'm doing:
-----------------------------------------------------------
TQuickRep ( FindComponent ( TableName.FieldByName
( 'MyFieldName' ).AsString ) ).Preview;
-----------------------------------------------------------

but I get a error message, saying:
-----------------------------------------------------------
Access violation at address 00418F70 in module 'ASSOC.EXE'. Read
of address FFFFFFFF
-----------------------------------------------------------

Do you have any ideas why this does not work?

Thanks a lot in advance.

Best regards,
Joaquim.

 

Re:Report's Preview "Access Violation"?


Ignore my previous reply.  I understand what you're trying to do now.

Not much help though.

-- Steve Cullen

Quote
"Joaquim Macedo" <joaquimmac...@yahoo.com> wrote in message

news:3c922e22$1_1@dnews...
Quote

> Hi all.

> I'm using Delphi 5 Enterprise, MS Access 97 ( with BDE ) and
> Quick Report 3.5.

> I want to Preview a report, that the name is stored on a
> database's table.

> On this moment, I'm doing:
> -----------------------------------------------------------
> TQuickRep ( FindComponent ( TableName.FieldByName
> ( 'MyFieldName' ).AsString ) ).Preview;
> -----------------------------------------------------------

> but I get a error message, saying:
> -----------------------------------------------------------
> Access violation at address 00418F70 in module 'ASSOC.EXE'. Read
> of address FFFFFFFF
> -----------------------------------------------------------

> Do you have any ideas why this does not work?

> Thanks a lot in advance.

> Best regards,
> Joaquim.

Re:Report's Preview "Access Violation"?


It looks like you're trying to preview a field in the report??

Try:

    QuickRep1.Preview;

This previews the whole report.  I don't think you can just preview a field
in the database.

-- Steve Cullen

Quote
"Joaquim Macedo" <joaquimmac...@yahoo.com> wrote in message

news:3c922e22$1_1@dnews...
Quote

> Hi all.

> I'm using Delphi 5 Enterprise, MS Access 97 ( with BDE ) and
> Quick Report 3.5.

> I want to Preview a report, that the name is stored on a
> database's table.

> On this moment, I'm doing:
> -----------------------------------------------------------
> TQuickRep ( FindComponent ( TableName.FieldByName
> ( 'MyFieldName' ).AsString ) ).Preview;
> -----------------------------------------------------------

> but I get a error message, saying:
> -----------------------------------------------------------
> Access violation at address 00418F70 in module 'ASSOC.EXE'. Read
> of address FFFFFFFF
> -----------------------------------------------------------

> Do you have any ideas why this does not work?

> Thanks a lot in advance.

> Best regards,
> Joaquim.

Re:Report's Preview "Access Violation"?


Maybe totally besides the point, but did you enter the quickreports units in
the uses clause of the form from which you call preview?

Lee-Z

Quote
"Joaquim Macedo" <joaquimmac...@yahoo.com> wrote in message

news:3c922e22$1_1@dnews...
Quote

> Hi all.

> I'm using Delphi 5 Enterprise, MS Access 97 ( with BDE ) and
> Quick Report 3.5.

> I want to Preview a report, that the name is stored on a
> database's table.

> On this moment, I'm doing:
> -----------------------------------------------------------
> TQuickRep ( FindComponent ( TableName.FieldByName
> ( 'MyFieldName' ).AsString ) ).Preview;
> -----------------------------------------------------------

> but I get a error message, saying:
> -----------------------------------------------------------
> Access violation at address 00418F70 in module 'ASSOC.EXE'. Read
> of address FFFFFFFF
> -----------------------------------------------------------

> Do you have any ideas why this does not work?

> Thanks a lot in advance.

> Best regards,
> Joaquim.

Re:Report's Preview "Access Violation"?


"Lee-Z" <l.vos...@nospamcss.nl> schreef in bericht news:3ca477cb_2@dnews...
Quote
> Maybe totally besides the point, but did you enter the quickreports units
in
> the uses clause of the form from which you call preview?

> > I'm using Delphi 5 Enterprise, MS Access 97 ( with BDE ) and
> > Quick Report 3.5.

> > I want to Preview a report, that the name is stored on a
> > database's table.

> > On this moment, I'm doing:
> > -----------------------------------------------------------
> > TQuickRep ( FindComponent ( TableName.FieldByName
> > ( 'MyFieldName' ).AsString ) ).Preview;
> > -----------------------------------------------------------
> > -----------------------------------------------------------
> > Access violation at address 00418F70 in module 'ASSOC.EXE'. Read
> > of address FFFFFFFF
> > -----------------------------------------------------------

... The FFFFFFF means you are calling a non existent component. So check if
everything is properly created before calling this. Try hardcoding an
existing fieldname and check if the error re-occurs. If not, then you are
one of the legion of victims of the fuzzy string-handling of Delphi (PChar,
[], String,Array of Char, Null-terminated etc. etc.).

Hope you figure it out...

Cu,
Ron

Other Threads