[求助]为什么数据保存出现问题?
Dim tablename As Stringtablename = "result_info"
searchsql = "select * from result_Info"
Dim myMod As System.Reflection.Module = [Assembly].GetExecutingAssembly().GetModules()(0)
Dim Path As String = myMod.FullyQualifiedName.Replace(myMod.Name, "")
adocmd = New OleDbDataAdapter(searchsql, "provider=microsoft.jet.oledb.4.0;data source=" & Path & "sjk\student.mdb")
adocmd.Fill(ds, tablename)
mytable = ds.Tables.Item(0)
myrow = mytable.Rows.Item(rownumber)
myrow.Item(0) = Trim(Me.TextBox1.Text)
myrow.Item(1) = Trim(Me.TextBox2.Text)
myrow.Item(2) = Trim(Me.TextBox3.Text)
mytable.GetChanges()
cmd = New OleDbCommandBuilder(adocmd)
'使用自动生成的SQL语句
adocmd.Update(ds, tablename)
'对数据库进行更新
MsgBox("修改课程信息成功!", , "警告")
Me.TextBox1.Enabled = False
Me.TextBox2.Enabled = False
Me.TextBox3.Enabled = False
Me.Button6.Enabled = False
Me.Button7.Enabled = False
这是我写保存记录里的代码,运行到adocmd.Update(ds, tablename)就出现警告
对于不返回任何键列信息的selectcommand,不支持updatecommand的动态SQL生成
请高手们指点一下,小弟是个新手