VB+SQL数据库 进行修改处理时,“出现多步操作产生错误。请检查每一步的状态值。”是我的代码出现了错误吗
PrivateSubcmdSave_Click()g_strSql="select*frombookInfowhere书籍编号='"&txtBookID.Text&"'"...
Private Sub cmdSave_Click()
g_strSql = "select * from bookInfo where 书籍编号='" & txtBookID.Text & "'"
Adodc1.RecordSource = g_strSql
Adodc1.Refresh
'设置记录的字段值
Adodc1.Recordset.Fields("书籍编号") = txtBookID.Text
Adodc1.Recordset.Fields("书籍名称") = txtBookName.Text
Adodc1.Recordset.Fields("类别代码") = Mid(cboType.Text, 1, 1)
Adodc1.Recordset.Fields("出版社") = txtBookConcern.Text
Adodc1.Recordset.Fields("作者姓名") = txtWriter.Text
Adodc1.Recordset.Fields("书籍价格") = txtBookPrice.Text
Adodc1.Recordset.Fields("书籍页码") = txtPage.Text
Adodc1.Recordset.Fields("登记日期") = dtpRigDate.Value
' 保存修改!!!
Adodc1.Recordset.Update
MsgBox "保存修改完毕!", vbOKOnly, "提示"
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub 展开
g_strSql = "select * from bookInfo where 书籍编号='" & txtBookID.Text & "'"
Adodc1.RecordSource = g_strSql
Adodc1.Refresh
'设置记录的字段值
Adodc1.Recordset.Fields("书籍编号") = txtBookID.Text
Adodc1.Recordset.Fields("书籍名称") = txtBookName.Text
Adodc1.Recordset.Fields("类别代码") = Mid(cboType.Text, 1, 1)
Adodc1.Recordset.Fields("出版社") = txtBookConcern.Text
Adodc1.Recordset.Fields("作者姓名") = txtWriter.Text
Adodc1.Recordset.Fields("书籍价格") = txtBookPrice.Text
Adodc1.Recordset.Fields("书籍页码") = txtPage.Text
Adodc1.Recordset.Fields("登记日期") = dtpRigDate.Value
' 保存修改!!!
Adodc1.Recordset.Update
MsgBox "保存修改完毕!", vbOKOnly, "提示"
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询