为什么在第一次使用FILTER时不出错,而第二次使用时却出现bof或eof其中有一个为真,或者当前的记录已经删除的错误(100分)

  • 主题发起人 主题发起人 shuaihu
  • 开始时间 开始时间
S

shuaihu

Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下。
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, ADODB, Grids, DBGrids, StdCtrls;

type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
ADODataSet1: TADODataSet;
ADODataSet2: TADODataSet;
ADODataSet1gaoid: TAutoIncField;
ADODataSet1gaoxm: TWideStringField;
ADODataSet1lx: TDataSetField;
DataSource1: TDataSource;
DataSource2: TDataSource;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
ADODataSet2shuid: TAutoIncField;
ADODataSet2gaoid: TIntegerField;
ADODataSet2xb: TWideStringField;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
adodataset1.UpdateBatch ;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
adodataset2.UpdateBatch ;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
adodataset1.filter:='gaoid=96';
adodataset1.filtered:=true;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
adodataset1.filter:='';
adodataset1.filtered:=false;
end;

end.
第一次点button3时没有错误,而当你点了button4后再点button3时则出现上述错误
 
这是ADO的BUG,装完补丁后就不会了
 
装ADO的补丁,在cakk.126.com 有下的.
快结束此贴,让其它的FW看见了会说你不查已答贴子的.呵呵.
 
接受答案了.
 
后退
顶部