Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread dynamically created query
Wed, Jun 28 2006 2:12 PMPermanent Link

Marc Pelletier
Hello,

I am creating a query at runtime and associating it with a database in a
datamodule. The database directory is also dynamic.

I create the query like this
function TdmFPLink.CreateImageQuery( ): TDBIsamQuery;
begin
 result := TDBISAMQuery.Create( self);

 // dbImages is a DBIsamDatabase
 result.DatabaseName := dbImages.DatabaseName;

 result.SQL.Add( 'Select Image, Time from :TableName where Flight = :Flt
' );
 result.SQL.Add( 'and Time >= :StartTime and Time <= :EndTime ' );
 result.SQL.Add( 'order by Time' );

end;

and before opening it. I make sure the dbImages db has the appropriate
directory set by doing
       dbImages.Close;
       dbImages.Directory := fImagePath;

When I subsequently open the table I get a access error at a very low
address (8db), which implies something isn't being initialized properly.

Any ideas?

cheers

Marc Pelletier
Goldak Airborne Surveys
Wed, Jun 28 2006 5:17 PMPermanent Link

Marc Pelletier
Marc Pelletier <marc@stopspam.goldak.ca> wrote in
news:Xns97F07B1B68F42mmpp1234.dd@64.65.248.118:

>   result.SQL.Add( 'Select Image, Time from :TableName where Flight =
>   :Flt
> ' );
>   result.SQL.Add( 'and Time >= :StartTime and Time <= :EndTime ' );
>   result.SQL.Add( 'order by Time' );
>
>

Okay, you can't assign the table with a param. Got it.

Marc
Thu, Jun 29 2006 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Marc,

<< When I subsequently open the table I get a access error at a very low
address (8db), which implies something isn't being initialized properly. >>

You've already found the answer, but regardless, DBISAM shouldn't be AVing.
I will make sure that this is corrected.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image