Private Sub Command1_Click()
With Adodc1
.RecordSource = "select * from [你的表名] where [学号]='" & Text1.Text & "'"
.Refresh
Text2.Text = .Recordset("[学号]")
Text3.Text = IIf(IsNull(.Recordset(["姓名"])), "没有姓名", .Recordset(["姓名"]))
Text4.Text = IIf(IsNull(.Recordset(["籍贯"])), "没留籍贯", .Recordset(["籍贯"]))
End With
End Sub
用ADO控件,你不是说了嘛,绑定数据源