select count(*) as recordcount from tablename执行这个sql返回的recordcount就是tablename这个表的记录行数
查询的记录总数? ADOQuery1.RecordCount
这类代码到处都有。今天心情好,写一段给你吧。with adoquery do begin close; sql.clear; sql.add('select count(*) from tbl_test'); open; showmessage('tabel record count='+inttostr(recordcount)); close; end;
>>这类代码到处都有。今天心情好,写一段给你吧。我帮你修改一下吧,你的心情好过头了with adoquery do begin close; sql.clear; sql.add('select count(*) as recordcount from tbl_test'); open; showmessage('tabel record count='+inttostr(fieldbyname('recordcount').asInteger)); close; end;
1: AdoQuery1.RecordCount 2: Select count(*) as count_ from table
ADOQuery1.RecordCount
这类代码到处都有。今天心情好,写一段给你吧。with adoquery do
begin
close;
sql.clear;
sql.add('select count(*) from tbl_test');
open;
showmessage('tabel record count='+inttostr(recordcount));
close;
end;
begin
close;
sql.clear;
sql.add('select count(*) as recordcount from tbl_test');
open;
showmessage('tabel record count='+inttostr(fieldbyname('recordcount').asInteger));
close;
end;
2: Select count(*) as count_ from table