连接access数据库在运行更新后可以在立即窗口看到:
update 日记表 set 日期 =#2003-11-10# ,上午天气= 大雨,下午天气= '晴',最高气温 = 20,最低气温 = 10,生产进度 = dfddfd,存在问题 = '许多发大师傅的',质量情况 = '豆腐干认识应该色',来往文件 = '豆腐干认得感' 会议记录 = '反对歌颂个' 变更签证 = '单行本当然代表' 材料设备 = '翻跟斗发表计划飞机' 施工机具 = '非常牛肺疫机' 水电情况 = '广泛脑筋风格内' 项目编号 = '第三个工程项目' where 日期 =#2003-11-10# and 上午天气=' 大雨' and 下午天气= '晴'and 最高气温 = '20'and 最低气温 = '10' and 生产进度 = 'dfddfd' and 存在问题 = '许多发大师傅的' and 质量情况 = '豆腐干认识应该色' and 来往文件 = '豆腐干认得感' and 会议记录 = '反对歌颂个' and 变更签证 = '单行本当然代表' and 材料设备 = '翻跟斗发表计划飞机' and 施工机具 = '非常牛肺疫机' and 水电情况 = '广泛脑筋风格内' and 项目编号 = '第三个工程项目' 但是数据库没有更新 请帮帮忙看看错在哪 附原代码:
Private Sub mnusave_Click(Index As Integer)
On Error Resume Next
Dim intOK As Long
Dim strSql As String
strSql = "update 日记表 set 日期 =#" & DTPicker1.Value & "# ,"
strSql = strSql & "上午天气= " & Combo2.Text & ","
strSql = strSql & "下午天气= '" & Combo3.Text & "',"
strSql = strSql & "最高气温 = " & Text11.Text & ","
strSql = strSql & "最低气温 = " & Text12.Text & ","
strSql = strSql & "生产进度 = " & Text1.Text & ","
strSql = strSql & "存在问题 = '" & Text2.Text & "',"
strSql = strSql & "质量情况 = '" & Text3.Text & "',"
strSql = strSql & "来往文件 = '" & Text4.Text & "' "
strSql = strSql & "会议记录 = '" & Text5.Text & "' "
strSql = strSql & "变更签证 = '" & Text6.Text & "' "
strSql = strSql & "材料设备 = '" & Text7.Text & "' "
strSql = strSql & "施工机具 = '" & Text8.Text & "' "
strSql = strSql & "水电情况 = '" & Text9.Text & "' "
strSql = strSql & "项目编号 = '" & Combo4.Text & "' "
strSql = strSql & " where 日期 =#" & DTPicker1.Value & "# and "
strSql = strSql & "上午天气=' " & Combo2.Text & "' and "
strSql = strSql & "下午天气= '" & Combo3.Text & "'and "
strSql = strSql & "最高气温 = '" & Text11.Text & "'and "
strSql = strSql & "最低气温 = '" & Text12.Text & "' and "
strSql = strSql & "生产进度 = '" & Text1.Text & "' and "
strSql = strSql & "存在问题 = '" & Text2.Text & "' and "
strSql = strSql & "质量情况 = '" & Text3.Text & "' and "
strSql = strSql & "来往文件 = '" & Text4.Text & "' and "
strSql = strSql & "会议记录 = '" & Text5.Text & "' and "
strSql = strSql & "变更签证 = '" & Text6.Text & "' and "
strSql = strSql & "材料设备 = '" & Text7.Text & "' and "
strSql = strSql & "施工机具 = '" & Text8.Text & "' and "
strSql = strSql & "水电情况 = '" & Text9.Text & "' and "
strSql = strSql & "项目编号 = '" & Combo4.Text & "' "
Debug.Print strSql
Set objrc = New ADODB.Recordset
objrc.CursorLocation = adUseClient
objrc.CursorType = adOpenDynamic
objrc.Open strSql, objcn
objrc.Update
objrc.Save
MsgBox "修改成功"
End Sub
update 日记表 set 日期 =#2003-11-10# ,上午天气= 大雨,下午天气= '晴',最高气温 = 20,最低气温 = 10,生产进度 = dfddfd,存在问题 = '许多发大师傅的',质量情况 = '豆腐干认识应该色',来往文件 = '豆腐干认得感' 会议记录 = '反对歌颂个' 变更签证 = '单行本当然代表' 材料设备 = '翻跟斗发表计划飞机' 施工机具 = '非常牛肺疫机' 水电情况 = '广泛脑筋风格内' 项目编号 = '第三个工程项目' where 日期 =#2003-11-10# and 上午天气=' 大雨' and 下午天气= '晴'and 最高气温 = '20'and 最低气温 = '10' and 生产进度 = 'dfddfd' and 存在问题 = '许多发大师傅的' and 质量情况 = '豆腐干认识应该色' and 来往文件 = '豆腐干认得感' and 会议记录 = '反对歌颂个' and 变更签证 = '单行本当然代表' and 材料设备 = '翻跟斗发表计划飞机' and 施工机具 = '非常牛肺疫机' and 水电情况 = '广泛脑筋风格内' and 项目编号 = '第三个工程项目' 但是数据库没有更新 请帮帮忙看看错在哪 附原代码:
Private Sub mnusave_Click(Index As Integer)
On Error Resume Next
Dim intOK As Long
Dim strSql As String
strSql = "update 日记表 set 日期 =#" & DTPicker1.Value & "# ,"
strSql = strSql & "上午天气= " & Combo2.Text & ","
strSql = strSql & "下午天气= '" & Combo3.Text & "',"
strSql = strSql & "最高气温 = " & Text11.Text & ","
strSql = strSql & "最低气温 = " & Text12.Text & ","
strSql = strSql & "生产进度 = " & Text1.Text & ","
strSql = strSql & "存在问题 = '" & Text2.Text & "',"
strSql = strSql & "质量情况 = '" & Text3.Text & "',"
strSql = strSql & "来往文件 = '" & Text4.Text & "' "
strSql = strSql & "会议记录 = '" & Text5.Text & "' "
strSql = strSql & "变更签证 = '" & Text6.Text & "' "
strSql = strSql & "材料设备 = '" & Text7.Text & "' "
strSql = strSql & "施工机具 = '" & Text8.Text & "' "
strSql = strSql & "水电情况 = '" & Text9.Text & "' "
strSql = strSql & "项目编号 = '" & Combo4.Text & "' "
strSql = strSql & " where 日期 =#" & DTPicker1.Value & "# and "
strSql = strSql & "上午天气=' " & Combo2.Text & "' and "
strSql = strSql & "下午天气= '" & Combo3.Text & "'and "
strSql = strSql & "最高气温 = '" & Text11.Text & "'and "
strSql = strSql & "最低气温 = '" & Text12.Text & "' and "
strSql = strSql & "生产进度 = '" & Text1.Text & "' and "
strSql = strSql & "存在问题 = '" & Text2.Text & "' and "
strSql = strSql & "质量情况 = '" & Text3.Text & "' and "
strSql = strSql & "来往文件 = '" & Text4.Text & "' and "
strSql = strSql & "会议记录 = '" & Text5.Text & "' and "
strSql = strSql & "变更签证 = '" & Text6.Text & "' and "
strSql = strSql & "材料设备 = '" & Text7.Text & "' and "
strSql = strSql & "施工机具 = '" & Text8.Text & "' and "
strSql = strSql & "水电情况 = '" & Text9.Text & "' and "
strSql = strSql & "项目编号 = '" & Combo4.Text & "' "
Debug.Print strSql
Set objrc = New ADODB.Recordset
objrc.CursorLocation = adUseClient
objrc.CursorType = adOpenDynamic
objrc.Open strSql, objcn
objrc.Update
objrc.Save
MsgBox "修改成功"
End Sub
建议你去掉 on error resume next 这句,你就可以看到错误了。