Board index » delphi » Runtime error 216 - EAccessViolation

Runtime error 216 - EAccessViolation


2003-12-18 12:01:23 AM
delphi52
I have a sql query in a unit that runs without a form and I get the run time
error when building the SQL. When I execute the query from a form it runs
fine.
Sample of code;
ManaDataModule.tronQry.Close;
ManaDataModule.tronQry.SQL.Clear;
ManaDataModule.tronQry.SQL.Add('Select count(Taxr_Delq_Run_No) as
CNT_RAILROAD from CCTAXR cctaxr');
ManaDataModule.tronQry.SQL.Add(' Where TAXR_YEAR = 2003');
ManaDataModule.tronQry.SQL.Add(' And TAXR_DELQ_RUN_NO = ' + '''3''');
ManaDataModule.tronQry.SQL.Text;
ManaDataModule.tronQry.Open;
thanks for any advice
David
 
 

Re:Runtime error 216 - EAccessViolation

David,
And the database is...?
Data access components (TQuery, TADODataSet, etc) are...?
Your version of Delphi is...?
Does the SQL work at design time (placing the SQL in the SQL/CommandText
property and setting Active = True)?
krf
"David Sudduth" <XXXX@XXXXX.COM>writes
Quote
I have a sql query in a unit that runs without a form and I get the run
time
error when building the SQL. When I execute the query from a form it runs
fine.
 

Re:Runtime error 216 - EAccessViolation

DB = Oracle
Data Access = TQuery
SQL work at design time = yes
"Kevin Frevert" <XXXX@XXXXX.COM>writes
Quote
David,

And the database is...?
Data access components (TQuery, TADODataSet, etc) are...?
Your version of Delphi is...?
Does the SQL work at design time (placing the SQL in the SQL/CommandText
property and setting Active = True)?

krf

"David Sudduth" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>I have a sql query in a unit that runs without a form and I get the run
time
>error when building the SQL. When I execute the query from a form it
runs
>fine.


 

Re:Runtime error 216 - EAccessViolation

David,
Do you know where in the code the access violation occurs?
Just curious (there is nothing wrong with what your doing), why don't you
set up the query at design time?
krf
"David Sudduth" <XXXX@XXXXX.COM>writes
Quote
DB = Oracle
Data Access = TQuery
SQL work at design time = yes
 

Re:Runtime error 216 - EAccessViolation

I appears to occur at the first query statement (e.g.
ManaDataModule.tronQry.Close;)
I do set the query up at design time.
David
"Kevin Frevert" <XXXX@XXXXX.COM>writes
Quote
David,

Do you know where in the code the access violation occurs?

Just curious (there is nothing wrong with what your doing), why don't you
set up the query at design time?

krf

"David Sudduth" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>DB = Oracle
>Data Access = TQuery
>SQL work at design time = yes


 

Re:Runtime error 216 - EAccessViolation

David,
Check out www.fulltextsearch.com (search on your runtime 216 error)
There were several mentions of quirks with the Oracle client and the BDE.
Good luck,
krf
"David Sudduth" <XXXX@XXXXX.COM>writes
Quote
I appears to occur at the first query statement (e.g.
ManaDataModule.tronQry.Close;)
I do set the query up at design time.

David
 

Re:Runtime error 216 - EAccessViolation

Thanks for the link.
Merry Christmas
David
"Kevin Frevert" <XXXX@XXXXX.COM>writes
Quote
David,

Check out www.fulltextsearch.com (search on your runtime 216 error)
There were several mentions of quirks with the Oracle client and the BDE.

Good luck,
krf

"David Sudduth" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>I appears to occur at the first query statement (e.g.
>ManaDataModule.tronQry.Close;)
>I do set the query up at design time.
>
>David


 

Re:Runtime error 216 - EAccessViolation

catch it in the try except raise end; Place the .Close in there and see the
error message of the raise. Probably you will get the same error but... have a
look.
btw is your datamodule created?
George Christoforakis.
"David Sudduth" <XXXX@XXXXX.COM>writes
Quote
I appears to occur at the first query statement (e.g.
ManaDataModule.tronQry.Close;)
I do set the query up at design time.

David

"Kevin Frevert" <XXXX@XXXXX.COM>writes
news:3fe0d01c$XXXX@XXXXX.COM...
>David,
>
>Do you know where in the code the access violation occurs?
>
>Just curious (there is nothing wrong with what your doing), why don't
you
>set up the query at design time?
>
>krf
>
>"David Sudduth" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>DB = Oracle
>>Data Access = TQuery
>>SQL work at design time = yes
>
>