一个asp的问题,提示缺少对象,怎么修改啊
<%IfRequest.Form("realname")<>""AndRequest.Form("email")<>""ThendimUserId,strSql,db'从...
<%
If Request.Form("realname")<>"" And Request.Form("email")<>"" Then
dim UserId,strSql,db
'从Session中获取用户名
UserId=session("UserId")
'下面组织SQL语句,因为某些项目允许为空,所以需要判断一下
strSql="Update users Set realname='" & Request.Form("RealName") & "'"
strSql=strSql & ",email='" & Request.Form("email") & "'"
strSql=strSql & ",sex='" & Request.Form("sex") & "'"
strSql=strSql & ",SubmitDate=#" & Date() & "#"
strSql=strSql & ",Address='" & Request.Form("address") & "'"
strSql=strSql & ",postalcode='" & Request.Form("postalcode") & "'"
If Request("QQ") <> "" Then
strSql = strSql & ",QQ='" & Request.Form("QQ") & "'"
End If
If Request("tel") <> "" Then
strSql = strSql & ",tel='" & Request.Form("tel") & "'"
End If
If Request("intro") <> "" Then
strSql = strSql & ",intro='" & Request.Form("intro") & "'"
End If
strSql=strSql & " Where UserId='" & UserId & "'"
db.Execute(strSql)
'关闭对象
db.close
set db=nothing
Response.Redirect "register4.asp"
End If
%>
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/bookshop/log/register3.asp, 第 111 行 展开
If Request.Form("realname")<>"" And Request.Form("email")<>"" Then
dim UserId,strSql,db
'从Session中获取用户名
UserId=session("UserId")
'下面组织SQL语句,因为某些项目允许为空,所以需要判断一下
strSql="Update users Set realname='" & Request.Form("RealName") & "'"
strSql=strSql & ",email='" & Request.Form("email") & "'"
strSql=strSql & ",sex='" & Request.Form("sex") & "'"
strSql=strSql & ",SubmitDate=#" & Date() & "#"
strSql=strSql & ",Address='" & Request.Form("address") & "'"
strSql=strSql & ",postalcode='" & Request.Form("postalcode") & "'"
If Request("QQ") <> "" Then
strSql = strSql & ",QQ='" & Request.Form("QQ") & "'"
End If
If Request("tel") <> "" Then
strSql = strSql & ",tel='" & Request.Form("tel") & "'"
End If
If Request("intro") <> "" Then
strSql = strSql & ",intro='" & Request.Form("intro") & "'"
End If
strSql=strSql & " Where UserId='" & UserId & "'"
db.Execute(strSql)
'关闭对象
db.close
set db=nothing
Response.Redirect "register4.asp"
End If
%>
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/bookshop/log/register3.asp, 第 111 行 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询