在操作adoquery控件时,首先判断adoquery.recordset的属性是否为eof或bof, 例子如下: procedure TForm1.Button1Click(Sender: TObject); begin if adoquery1.Active then begin if adoquery1.Recordset.EOF and adoquery1.Recordset.BOF then adoquery1.Recordset.Close; adoquery1.Close; adoquery1.SQL.Clear ; adoquery1.SQL.add('SQL'); adoquery1.Open; if adoquery1.Eof and adoquery1.Bof then begin adoquery1.Recordset.Close; adoquery1.Close; exit; end else begin 对adoquery1操作。 end; end else begin end; end;
不过好象把一个什么属性改为readonlyyi就可以了
ski-hd3-c139 92x0-91x0
http://www.pchome.net/dl/delphi.htm
例子如下:
procedure TForm1.Button1Click(Sender: TObject);
begin
if adoquery1.Active then
begin
if adoquery1.Recordset.EOF and adoquery1.Recordset.BOF then
adoquery1.Recordset.Close;
adoquery1.Close;
adoquery1.SQL.Clear ;
adoquery1.SQL.add('SQL');
adoquery1.Open;
if adoquery1.Eof and adoquery1.Bof then
begin
adoquery1.Recordset.Close;
adoquery1.Close;
exit;
end
else
begin
对adoquery1操作。
end;
end
else
begin
end;
end;
为什么?? 加了补丁也没用!!!