标题:又出错,字段 'userinfor.user_name' 不能包含 Null 值,怎么回事?
只看楼主
chst
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-3-2
 问题点数:0 回复次数:4 
又出错,字段 'userinfor.user_name' 不能包含 Null 值,怎么回事?
出错问题:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC Microsoft Access Driver] 由于其 Required 属性设置为真(True),字段 'userinfor.user_name' 不能包含 Null 值。在此字段中输入一个数值。

/www.cnzz1.cn/submit_dt.asp,行 37

原代码为:
<%@ language=VBScript %>
<%
set conn=server.CreateObject("adodb.connection")
connstr="dbq="&server.MapPath("diaocha.mdb")&";driver={microsoft access driver (*.mdb)};"
conn.open connstr
set rec=server.CreateObject("adodb.recordset")
sqlstr="select * from userinfor"
rec.open sqlstr,conn,2,3
rec.addnew
rec("user_name")=request.form("user_name")
rec("user_id")=request.form("user_id")
rec("user_tel")=request.form("user_tel")
rec("user_add")=request.form("user_add")
rec("answer1")=request.form("answer1")
rec("answer2")=request.form("answer2")
rec("answer3")=request.form("answer3")
rec("answer4")=request.form("answer4")
rec("answer5")=request.form("answer5")
rec("answer6")=request.form("answer6")
rec("answer7")=request.form("answer7")
rec("answer8")=request.form("answer8")
rec("answer9")=request.form("answer9")
rec("answer10")=request.form("answer10")
rec("answer11")=request.form("answer11")
rec("answer12")=request.form("answer12")
rec("answer13")=request.form("answer13")
rec("answer14")=request.form("answer14")
rec("answer15")=request.form("answer15")
rec("answer16")=request.form("answer16")
rec("user_job")=request.form("answer17")
rec("answer18")=request.form("answer18")
rec("answer19")=request.form("answer19")
rec("answer20")=request.form("answer20")
rec("answer21")=request.form("answer21")
rec("answer22")=request.form("answer22")
rec("user_sex")=request.form("answer23")
rec.update
rec.close
set rec=nothing
response.redirect "sucess.asp"

%>
请高手指教!

搜索更多相关主题的帖子: name 字段 Null userinfor 
2006-03-03 16:42
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
得分:0 
不是很明显吗?

字段 'userinfor.user_name' 不能包含 Null 值

天津网站建设 http://www./
2006-03-03 17:17
chst
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-3-2
得分:0 

是啊,我将access的数据库,将“必填字段”改为否 “允许空字符串“这样行,但我不改数据库,在代码中如何改正?

2006-03-03 17:57
dennis
Rank: 1
等 级:新手上路
帖 子:102
专家分:0
注 册:2006-2-17
得分:0 
在代码中你肯定是那个request.form("user_name")没得到值咯
2006-03-04 09:40
kljun
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-9-10
得分:0 
if request.form("user_name")<>"" then
rec("user_name")=request.form("user_name")
end if

http://www./ 野岛.net-百秒小故事 哲理小故事、打工故事、创业故事。
2006-03-05 21:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-48278-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.162023 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved