Private Sub form_load()
Dim CN As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\file.mdb;Persist Security Info=False"
sql = "select * FROM student"
rs.Open sql, CN, 1, 1
Text1.Text = rs("sno")
Text2.Text = rs("sname")
Text3.Text = rs("ssex")
Text4.Text = rs("sage")
End Sub
Private Sub Command1_Click()
rs.MoveFirst
End Sub
Private Sub Command2_Click()
rs.MovePrevious
End Sub
Private Sub Command3_Click()
rs.MoveNext
End Sub
Private Sub Command4_Click()
rs.MoveLast
End Sub
代码运行结果出现“实时错误,要求对象”,请问是哪里出错了呢?