assuming you've got a connection for ADOQuery1 already established...
uses
Dialogs, ADODB;
procedure GetData;
begin
with ADOQuery1.SQL do
begin
Clear;
Add('SELECT * FROM YOURTABLE'); { example, u know what SQL to use }
Add('WHERE YOURCONDITION');
end;
with ADOQuery1 do
try
ADOQuery1.Open;
if (not EOF) and (not State = dsInactive) then
WorkWithDate
else
ShowMessage('No results returned.');
finally
ADOQuery2.Close;
end;
end;
procedure WorkWithData;
begin
{ work through ADOQuery1 or pass the DataSet directly to this procedure and work with it }
end;
Main Topics
Browse All Topics





by: ImbeginnerPosted on 2003-04-12 at 20:37:34ID: 8320827
hi use
if adoquery1.isempty then
showmessage('your message');