查询ACCESS中数据的问题
如图```我想在输入完了学号后```在其他的text 和 combo中能显示出数据库中相应的信息``
但是输入后```界面上什么都不显示- -``请教高手解答``谢谢了``
Dim x, r As String
Dim SQL As String
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
On Error GoTo 20
Adodc1.RecordSource = "select * from 信息表"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox ("记录为空,请退出!")
Exit Sub
End If
x = InputBox("请输入学号,10位字符!", "提示")
If (x) = "" Then
MsgBox ("请选择字段!")
Text1.Text = ""
Exit Sub
End If
If Val(x) >= 1000000000 And Val(x) <= 9999999999# Then
Adodc1.RecordSource = "select * from 信息表 where x like" & "'%" & x & "%'" & " order by XH"
If Not Adodc1.Recordset.EOF Then
Adodc1.Refresh
Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Combo1.Text = Adodc1.Recordset.Fields(2)
Text3.Text = Adodc1.Recordset.Fields(3)
Text4.Text = Adodc1.Recordset.Fields(4)
Text5.Text = Adodc1.Recordset.Fields(5)
Combo2.Text = Adodc1.Recordset.Fields(6)
Text6.Text = Adodc1.Recordset.Fields(7)
Text7.Text = Adodc1.Recordset.Fields(8)
End If