现在代码运行出错,找不到哪里错了,请各位高手帮忙运行,找找错误点,告诉我修改方法。
这是代码Private Sub Combo1_Click()
Text1.Text = ""
Text2.Text = ""
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\guzhang.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from guolu Where 故障类型='" & Combo1.Text & "'"
Adodc1.Refresh
Text1.Text = Adodc1.Recordset.Fields("故障征兆")
Text2.Text = Adodc1.Recordset.Fields("故障原因")
Adodc1.Recordset.Close
End Sub
Private Sub Form_Load()
Combo1.Text = ""
Combo1.Clear
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\guzhang.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from guolu"
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
Combo1.AddItem Adodc1.Recordset.Fields("故障类型")
Adodc1.Recordset.MoveNext
Loop
Adodc1.Recordset.Close
End Sub
用access数据库 ado控件,一个combo 两个text
guzhang.rar
(15.18 KB)
这是部分数据库急需各位帮助,帮忙救救急