BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TADOQuery Abstract error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Peter Batten
Guest





PostPosted: Tue Oct 10, 2006 8:11 am    Post subject: TADOQuery Abstract error Reply with quote



Delphi 7 using ADO to link to MYOB.

I build a query which works correctly.

Second time I call the function to run the query I receive either an
EDatabaseError, and Abstract error or an Access Violation

try
quLocatePersonal := TADOQuery.Create(self);
quLocatePersonal.Connection := dmMYOBData.adoconMYOB;
quLocatePersonal.SQL.Clear;
quLocatePersonal.SQL.Add('Select CardIdentification, CardTypeID
from CARDS where CardRecordID = :CardRecordID');
quLocatePersonal.Parameters.ParamByName('CardRecordID').Value :=
fmCMS0.CurrentMYOBCardRecordID;
quLocatePersonal.Open;


finally
quLocatePersonal.Close;
if quLocatePersonal.Prepared then
quLocatePersonal.Prepared := False;
FreeAndNil(quLocatePersonal);
end;

If I change the initial statement to
quLocatePersonal := TADOQuery.Create(nil);
I do not get the error.

Any thoughts appreciated.

Peter
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.