我在此代码的表单子句中遇到语法错误,有人可以帮忙吗?谢谢 :)
Dim sql As String
Dim con As New OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet
con.ConnectionString = "PROVIDER = Microsoft.Jet.OLEDB.4.0; Data Source = G:\school\Thespellingbee\Resources\Spelling Bee1.mdb"
con.Open()
sql = "SELECT * FROM Words + Definitions"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Words + Definitions")
con.Close()
Dim cb As New OleDb.OleDbCommandBuilder(da) stored data adapter in the variable cb
WordTextBox.Text = ds.Tables("Words + Definitions").Rows(0).Item(2)
DescriptionTextBox.Text = ds.Tables("Words + Definitions").Rows(0).Item(3)
da.Update(ds, "Words + Definitions")
MsgBox("It's working", MessageBoxButtons.OK)
这是我尝试使用数据集和适配器更新数据库,我对 v basic 仍然相当陌生,因为我刚刚开始在 A-level 中学习它。