我要编一个程序,实现数据信息的显示 ,当到数据尾就回到头部,或出现提示信息,谢谢!

解决方案 »

  1.   

    Private Sub Command4_Click()
        ' True DBGrid will follow the record movement.
        Data1.Recordset.MoveFirst
        DBGrid1.SetFocus
    End SubPrivate Sub Command5_Click()
        ' True DBGrid will follow the record movement.    Data1.Recordset.MoveNext
        
        ' Keep the current record away from EOF, which is not a
        ' valid position.
        If Data1.Recordset.EOF = True Then
            Data1.Recordset.MovePrevious
        End If
        
        DBGrid1.SetFocus
    End SubPrivate Sub Command6_Click()
        ' True DBGrid will follow the record movement.    Data1.Recordset.MovePrevious
        
        ' Keep the current record away from BOF, which is not a
        ' valid position.
        If Data1.Recordset.BOF = True Then
            Data1.Recordset.MoveNext
        End If
        
        DBGrid1.SetFocus
    End SubPrivate Sub Command7_Click()
        ' True DBGrid will follow the record movement.    Data1.Recordset.MoveLast
        DBGrid1.SetFocus
    End Sub
      

  2.   

    if rs.eof then msgbox "已到尾部!" 或者
    if rs.eof then rs.movefirst