conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
sql = "select * from scholarship where scholarship_id = " & id & " "
rs_mima.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
rs_mima.Fields(1) = Trim(Text2.Text)
rs_mima.Fields(2) = Format(Val(Text3.Text), "#,##0.00")
rs_mima.Fields(3) = Val(Text4.Text)
rs_mima.Fields(4) = Trim(RichTextBox1.Text)
rs_mima.Update
MsgBox "更新成功!", vbOKCancel + vbInformation, "提示信息"
虽然显示更新成功,但是数据库里面的数据完全没有改变,这个是什么问题?
rs_mima.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
改成
rs_mima.Open sql, conn, 3,3,1
试试看~
具体的错误原因我不知道,答案是我知道无论错误还是正确,提示信息都会提示正确! “MsgBox "更新成功!", vbOKCancel + vbInformation, "提示信息"”
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
sql = "select * from scholarship where scholarship_id = " & id & " "
rs_mima.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
rs_mima.addnew 'rem 一类的,具体的我忘 了,因为我用insert into ,你看看吧,这里要先增加一条记录
rs_mima.Fields(1) = Trim(Text2.Text)
rs_mima.Fields(2) = Format(Val(Text3.Text), "#,##0.00")
rs_mima.Fields(3) = Val(Text4.Text)
rs_mima.Fields(4) = Trim(RichTextBox1.Text)
rs_mima.Update
MsgBox "更新成功!", vbOKCancel + vbInformation, "提示信息"