Office中国论坛/Access中国论坛

标题: 请问写入数据库为什么不成功? [打印本页]

作者: soaplayer    时间: 2006-11-19 02:00
标题: 请问写入数据库为什么不成功?
temp11 = Str(Me.from)
temp21 = Str(Me.to)
MsgBox temp11
MsgBox temp21
temprange = Str(temp11) & "---" & Str(temp21)
MsgBox temprange

strSQLhistry = "insert into QueryHistory (norange) values (" & temprange & ")"
DB.Execute strSQLhistry



写进去的是0....
作者: kangking    时间: 2006-11-19 17:24
把strSQLhistry = "insert into QueryHistory (norange) values (" & temprange & ")"
改为strSQLhistry = "insert into QueryHistory (norange) values ('" & temprange & "')"试试.





欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3