为何返回记录数是-1
zmcpu 2002-05-10 09:21:58 QUERY 查询出结果集已经显示出来,但为什么recordcount为-1?
源码如下:
with datafrm.Query2 do
begin
close;
sql.clear;
sql.Add('Select CustomerId,CustomerName,Address,Postcode,Touchman,');
sql.Add('phone,Fax,SuperiorName,BankName,AccountID,TaxID,NetAddress,Email,CustomerRemarks,TouchmanRemarks');
sql.Add (' From CustomerTable ');
sql.Add('order by customerid');
prepare;
open;
k:=recordcount;
end;
StaticText1.Caption :='符合条件的客户数量为:'+inttostr(k );