日期:2014-05-16 浏览次数:20819 次
QueryDataset := TADODataSet.Create(nil);
with QueryDataset do
begin
Active := False;
AutoCalcFields := True;
CommandType := cmdText;
CommandTimeout := 30;
CacheSize := 1;
AutoCalcFields := True;
CursorLocation := clUseClient;
CursorType := ctKeyset;
EnableBCD := True;
Filtered := False;
Prepared := False;
LockType := ltOptimistic;
MarshalOptions := moMarshalAll;
StoreDefs := False;
Tag := 0;
connectionstring := '';
try
Connection := Conn;
except
on e:Exception do begin
Result := False;
end;
CommandText := 'Select * from table order by idx';
end;
while not QueryDataset.Eof do
begin
Inc(NumberOfQueryResult);
QueryDataset.Next();
end;
Freeandnil(QueryDataset);