我是个vb初学者,请教在vb里能不能获得一条记录的记录号,就象vf理的recno()函数一样?比如下面的代码
If Not currec.BOF Then
currec.MovePrevious
RefreshForm ‘自定义函数,刷新表单
Else
MsgBox "已是首记录!", vbOKOnly, "错误"
End If
如果当前记录是第一条,not currec.bof 就会通过,但是执行了moveprevious后,bof就成立,执行refreshform就会出错。
If Not currec.BOF Then
currec.MovePrevious
RefreshForm ‘自定义函数,刷新表单
Else
MsgBox "已是首记录!", vbOKOnly, "错误"
End If
如果当前记录是第一条,not currec.bof 就会通过,但是执行了moveprevious后,bof就成立,执行refreshform就会出错。
If currec.BOF Then
currec.Movefirst
MsgBox "已是首记录!", vbOKOnly, "错误"
Else
currec.Previous
End If
currec.moveprevious
wend
rs.open("select * from tablename where id=1",conn,3,2)