recordset.MovePrevious 不能向上移动问题 急急急!!!
Private Sub Form_Load()Me.Move 6000, 2000
Set myConn = New ADODB.Connection
myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data\Bdfl2009.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
myConn.Open
With myRec
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.ActiveConnection = myConn
.Source = "select * from 建筑物防雷装置检测登记"
.Open
End With
myRec.MoveFirst
If myRec.EOF = False Then
CheckID = "" & myRec("检测编号")
Checkdate = "" & myRec("检测日期")
Company = "" & myRec("单位名称")
Danweidizhi = "" & myRec("单位地址")
Youbian = "" & myRec("邮编")
LianxiRen = "" & myRec("联系人")
PhoNo = "" & myRec("联系电话")
Beizhu = "" & myRec("备注")
XCFZRen = "" & myRec("现场负责人")
Checkitem = "" & myRec("检测单位")
Checkren = "" & myRec("检测人")
Shenheren = "" & myRec("审核人")
End If
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "upone" 向上移动记录
myRec.Close
myRec.Open
myRec.MovePrevious
If Not myRec.BOF Then
错误:myRec.BOF 一直为TRUE 不能向上移动.我的表里面有3条数据,向下移动可以.多次实验得出记录指针一直指向第一条记录.请大侠们帮忙啊.
CheckID = myRec("检测编号")
Checkdate = myRec("检测日期")
Company = myRec("单位名称")
Danweidizhi = myRec("单位地址")
Youbian = myRec("邮编")
LianxiRen = myRec("联系人")
PhoNo = myRec("联系电话")
Beizhu = myRec("备注")
XCFZRen = myRec("现场负责人")
Checkitem = myRec("检测单位")
Checkren = myRec("检测人")
Shenheren = myRec("审核人")
Else
'MsgBox "ffff"
End If
End Select
End Sub