Check to know , Is TADOQuery created or not ...
Posted on 2006-06-18
i have a problem with TADOQuery,
i made a Query in my form like this :
SQuery.connection:=my_connection; //this connection exist and set to DB
SQuery.SQL.Text := 'select * from car';
SDataSource := TDataSource.Create(nil);
SDataSource.DataSet := SQuery;
DBGrid1.DataSource := SDataSource;
i wanna release Query and i know that i must write SQuery.Free; but i wanna first check that my Query created or not ?
if Query exist then i wanna free it else i dont want to do anything,
how can i check it, what's the commands for that ?