这条语句Set DataGrid1.DataSource = Adodc2 为什么出错?我有两个表,一个表一开始和Adodc1绑定
DataGrid1显示表1里的内容。我相在我单击单选按钮时,DataGrid1中的内容显示表2里的内容。我就设
Set DataGrid1.DataSource = Adodc2
DataGrid1.Refresh
可是出错呀。谢谢给予指导。
DataGrid1显示表1里的内容。我相在我单击单选按钮时,DataGrid1中的内容显示表2里的内容。我就设
Set DataGrid1.DataSource = Adodc2
DataGrid1.Refresh
可是出错呀。谢谢给予指导。
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
option2的click事件中为
Set DataGrid1.DataSource = Noting
Set DataGrid1.DataSource = Adodc2
运行时,Set DataGrid1.DataSource = Noting这一句出错。为什么
Private Sub Option1_Click()
With Adodc1
.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & App.Path & "\\fld.mdb;Persist Security Info=False"
.CommandType = adCmdText
.RecordSource = "select * from table1"
.Refresh
End With
Set DataGrid1.DataSource = Adodc1
End SubPrivate Sub Option2_Click()
With Adodc2
.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & App.Path & "\\fld.mdb;Persist Security Info=False"
.CommandType = adCmdText
.RecordSource = "select * from table2"
.Refresh
End With
Set DataGrid1.DataSource = Adodc2
End Sub
试过了,没问题.