一般不这样写
AdoRst.MovePrevious;
If AdoRst.Bof Then AdoRst.movefirst;也没有必要使用 “CreateOleObject创建了ADODB.Recordset和ADODB.Connection"
如果想直接访问rescordset 可以用 adotable.recordset;adoquery.reacordset
adodataset.recordset
 

解决方案 »

  1.   

    这里好象是一个BUG
    我用ADO觉得非常怪
      

  2.   

    AdoRst.MovePrevious;
    Edit1.Text=AdoRst.Fields[0]; 
    If AdoRst.Bof Then 
      Begin
        Button1.Enabled:=False;
        Exit;
      end; 
      

  3.   

    错了,是这样的。
    AdoRst.MovePrevious;
    If AdoRst.Bof Then 
      Begin
        Button1.Enabled:=False;
        Exit;
      end;
    Edit1.Text=AdoRst.Fields[0]; 
      

  4.   

    回复clacklin:
    代码没有出现错误,谢谢!只是应把adorst.moveprevious写在Exit的后面。