Private Sub Command1_Click() '下一条记录
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast
Text1 = Adodc1.Recordset.Fields("用户名").Value
Text2 = Adodc1.Recordset.Fields("年龄").Value
Text3 = Adodc1.Recordset.Fields("性别").Value
End Sub
Private Sub Command2_Click() '第一条记录
Adodc1.Recordset.MoveFirst
Text1 = Adodc1.Recordset.Fields("用户名").Value
Text2 = Adodc1.Recordset.Fields("年龄").Value
Text3 = Adodc1.Recordset.Fields("性别").Value
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\AAA.mdb;Persist Security Info=False;Jet OLEDB:Database Password=1234;"
Adodc1.RecordSource = "select * from 人员 ORDER BY ID"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
Text1 = Adodc1.Recordset.Fields("用户名").Value
Text2 = Adodc1.Recordset.Fields("年龄").Value
Text3 = Adodc1.Recordset.Fields("性别").Value
End Sub