Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EOF error when closing ADOQuery!

Status
Not open for further replies.

jcfrasco

IS-IT--Management
Apr 27, 2001
89
US
I created a program that uses an ADOQuery object to attach to SQL Server 2000. It retrieves a list of tools and displays them in a grid. The user has the ability to type in a specific tool ID and with each OnChange event of the text box I close the ADOQuery object and set the SQL to search for records that start with that letter and any additional letters after each one is typed. The drill down works well until no records are found and the recordset is at EOF. This causes an error because it will not allow me to close the ADOQuery object to reset it if it is set to EOF. How can I overcome this obstacle or rewrite it to be more resource friendly.

I appreciate any help in this matter.

jcfrasco
 
Maybe something like this.. ?

ADOQuery.SQL.Clear;
SQL := 'bla..bla...';
ADOQuery.SQL.Text := SQL;
ADOQuery.Active := True;

if not ADOQuery.IsEmpty then
//do something
else
//free
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top