If Not myrecord.BOF Then
   
   myrecord.MoveFirst
   
   
Else
   myrecord.MovePrevious
   
End If  可以但
If Not myrecord.BOF Then
   
   myrecord.Movelast   向上一条就不可以
   
   
Else
   myrecord.MovePrevious
   
End If

解决方案 »

  1.   

    Private myconn As New ADODB.Connection
    Private myrecord As New ADODB.Recordset这样定义完的 变量对于
        myrecord.Move 5, adBookFirst
      提示 当前recordset不支持书签,这可能是提供者或光标选定类型限定的如不加adBookFirst 可以运行
      

  2.   

    myrecord.Movelast   向上一条就不可以//你这个问题不对,movelast是移动到最后一条,而不是上一条我不知道你为什么那么写,按你说的可以的情况,我没测试过,但是按照我的经验,也应该是错误的,按照BOF或者EOF只要是移动记录集合全部会出错你根本没必要这样写,用on error resume next可以过滤掉所有错误
      

  3.   

    这样定义完的 变量对于
        myrecord.Move 5, adBookFirst
      提示 当前recordset不支持书签,这可能是提供者或光标选定类型限定的如不加adBookFirst 可以运行//你最好看一下ADO的帮助手册(搜索你硬盘中间叫做ado210.chm的文件)看一下MOVE方法:
    Move Method
          Moves the position of the current record in a Recordset object.Syntaxrecordset.Move NumRecords, StartParametersNumRecords   A signed Long expression specifying the number of records the current record position moves.Start   Optional. A String or Variant that evaluates to a book. You can also use one of the following BookEnum values:Constant Description 
    adBookCurrent Default. Start at the current record. 
    adBookFirst Start at the first record. 
    adBookLast Start at the last record. 
     adBookFirst本身只是一个参数,需要你进行位置指定的,比如 adBookFirst可以为1,可以为2,它本身是有默认数值的,但是VB不会知道它是个什么东西.LZ你需要靠下ADO帮助手册,一些最基本的知识你还没掌握.