ed
2005-09-20 00:52:34 UTC
Hi all,
I'm trying to get a table's record/row count using the following piece of
code:
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select count(*) as countrex from accountdata');
ADOQuery1.ExecSQL;
Label1.Caption := 'Total Records in table : ' +
IntToStr(ADOQuery1countrex.AsInteger);
Unfortunately, it returns 0 every time although I know that the table in
question has over 1,000 records. Incidentally, at design time, it works
fine and returns the correct result when I make the Query active.
Any help appreciated.
Regards,
ed
I'm trying to get a table's record/row count using the following piece of
code:
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select count(*) as countrex from accountdata');
ADOQuery1.ExecSQL;
Label1.Caption := 'Total Records in table : ' +
IntToStr(ADOQuery1countrex.AsInteger);
Unfortunately, it returns 0 every time although I know that the table in
question has over 1,000 records. Incidentally, at design time, it works
fine and returns the correct result when I make the Query active.
Any help appreciated.
Regards,
ed