Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\wuzi.mdb;Persist Security Info=False"
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "kucun"
Adodc1.Refresh
End Sub
------------------------------------------
Private Sub DataCombo1_Change()
Dim sql As String
sql = "select * from kucun where 名称 ='" & DataCombo1.BoundText & " '"
Adodc1.RecordSource = sql
Adodc1.Recordset.Fields("名称") = DataCombo1.BoundText
Adodc1.Refresh
End Sub
以上我用adodc绑定了一个MSHFlexGrid1,窗体启动时显示所有的记录,然后在DataCombo1里选择我要查询字段的值,为什么在DataCombo1里选择后,MSHFlexGrid1仍然显示的是全部记录,提示说from子语法错误,对象Refresh的方法IAdodc失败呢?多谢!!!!!!
[此贴子已经被作者于2007-1-2 23:52:07编辑过]