我有这样的代码(还没有完成,因为我不知道访问连接设置)
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim golmin As String
golmin = ComboBox1.SelectedText
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:/Users/RUMAH49/Documents/Visual Studio 2008/Projects/Project-Christian/Project-Christian/MineralDB.mdb"
con.Open()
sql = "SELECT [Nama Mineral] FROM MsMineral WHERE [Golongan Mineral] LIKE '" + golmin + "'"
da = New OleDb.OleDbDataAdapter(sql, con)
End Sub
我想用上面的查询填充 combobox2 列表。我怎么做?此连接是否不正确,还是我仍需使用数据集向导?