我刚学完数据库,写了很一般的程序,但是我运行完了之后发现第一条记录是空的,为什么呢?要怎么样才能不会 出现空记录呢?
我的程序代码如下:
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
End SubPrivate Sub Command2_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
End SubPrivate Sub Command3_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End SubPrivate Sub Command4_Click()
Data1.Recordset.MoveLast
End Sub
我的程序代码如下:
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
End SubPrivate Sub Command2_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
End SubPrivate Sub Command3_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End SubPrivate Sub Command4_Click()
Data1.Recordset.MoveLast
End Sub
if data1.recordset.bof then data1.recordset.movenext
on error goto 0这并不是第一条记录是空的,
而是BOF时是显示空的。