这是代码;
Private Sub txtNProdname_Click()
Set Rs = New ADODB.Recordset
With Rs
.ActiveConnection = Conn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockPessimistic
.Source = "SELECT proddescription FROM products WHERE prodsupplier=" & "'" & txtNsupplier.Text & "' AND prodname=" & "'" & txtNProdname.Text & "'"
.Open
txtNdescription.Text = Rs("proddescription")
End With
End Sub错误:
Either BOF or EOF is True, or the current record has been deleted.Requested operation requires a current record.你能帮我吗?似乎没有AND它也能工作,但是当我把它放进去的时候,错误就发生了。
发布于 2013-03-24 23:06:25
打开记录集后,您需要先移动到第一条记录,然后才能使用它:
Rs.Open
If Rs.EOF = False Then
Rs.MoveFirst
txtNdescription.Text = Rs("proddescription")
End Ifhttps://stackoverflow.com/questions/15599986
复制相似问题