请问如何解决:标准表达式中数据类型不匹配 出现的问题!

andie2008 2005-12-06 11:04:10
错误信息:
Microsoft JET Database Engine (0x80040E07)
标准表达式中数据类型不匹配。
/test/reg_save.asp, 第 116

第 116 为: rs.open sql,conn

源代码:

<title>Member Login!</title><!--#include file="include/ebase.asp"-->
<%
call aspsql()
UserId=request.form("UserId")
Userpw1=request.form("Userpw1")
Userpw2=request.form("Userpw2")
Userfirstname=request.form("Userfirstname")
Userlastname=request.form("Userlastname")
Sex=request.form("Sex")
Userstate=request.form("Userstate")
Email=request.form("Email")
Address=request.form("Address")
Postcode=request.form("Postcode")
User_question=request.form("User_question")
User_answer=request.form("User_answer")
Birthmonth=request.form("Birthmonth")
Birthdate=request.form("Birthdate")
Birthyear=request.form("Birthyear")
Zip=request.form("Zip")
Alt_email=request.form("Alt_email")

SQL="insert into buser([UserId],[Userpw1],[Userpw2],[Userfirstname],[Userlastname],[Sex],[Userstate],[Email],[Address],[Postcode],[User_question],[User_answer],[Birthmonth],[Birthdate],[Birthyear],[Zip],[Alt_email])values('"&UserId&"','"&Userpw1&"','"&Userpw2&"','"&Userfirstname&"','"&Userlastname&"','"&Sex&"','"&Userstate&"','"&Email&"','"&Address&"','"&Postcode&"','"&User_question&"','"&User_answer&"','"&Birthmonth&"','"&Birthdate&"','"&Birthyear&"','"&Zip&"','"&Alt_email&"')"


if UserId="" then
response.write("Clew:Please input your member ID!")
response.end
end if

if Userpw1="" then
response.write("Clew:Please input your member password!")
response.end
end if

if Userpw2="" then
response.write("Clew:You input that password unlineliness twice, please input it again.")
response.end
end if

If request.form("Userpw1") <> request.form("Userpw2") then
response.write"Clew:You input that password unlineliness twice, please input it again!"
response.end
end if

if Userfirstname="" then
response.write("Clew:Please input your firstname!")
response.end
end if

if Userlastname="" then
response.write("Clew:Please input your lastname!")
response.end
end if

if Sex="" then
response.write("Clew:Please select your sex!")
response.end
end if

if Userstate="" then
response.write("Clew:Please input your state!")
response.end
end if

if Email="" then
response.write("Clew:Please input your effective emailaddress!")
response.end
end if

if Address="" then
response.write("Clew:please input your address !")
response.end
end if

if Postcode="" then
response.write("Clew:please input your postcode!")
response.end
end if

if User_question="" then
response.write("Clew:please input your question for ask userpw!")
response.end
end if

if User_answer="" then
response.write("Clew:please input your answer for ask userpw!")
response.end
end if

if Birthmonth="" then
response.write("Clew:please select your month!")
response.end

end if
if Birthdate="" then
response.write("Clew:please select your date!")
response.end
end if

if Birthyear="" then
response.write("Clew:please input your year!")
response.end
end if

if Zip="" then
response.write("Clew:please input your zip!")
response.end
end if

if Alt_email="" then
response.write("Clew:please input your alt-email!")
response.end
end if

set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn
if err.number>0 Then
Response.Write("You can't to be our member, please try it again!")
else
response.write("Welcome to you----ChinaEbase!")
end if
%>

...全文
203 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
andie2008 2005-12-06
  • 打赏
  • 举报
回复
哦。原来如此!
那字符型就是文本数据类型。
数字型就是数字类型了。对吗?
谢谢各位了!
yongz_0 2005-12-06
  • 打赏
  • 举报
回复
贴这么长干吗,你的sql不对
如果是字符型: '"& 变量 &"'
数字: "&变量&"
leakey8 2005-12-06
  • 打赏
  • 举报
回复
SQL="insert into buser([UserId],[Userpw1],[Userpw2],[Userfirstname],[Userlastname],[Sex],[Userstate],[Email],[Address],[Postcode],[User_question],[User_answer],[Birthmonth],[Birthdate],[Birthyear],[Zip],[Alt_email])values('"&UserId&"','"&Userpw1&"','"&Userpw2&"','"&Userfirstname&"','"&Userlastname&"','"&Sex&"','"&Userstate&"','"&Email&"','"&Address&"','"&Postcode&"','"&User_question&"','"&User_answer&"','"&Birthmonth&"','"&Birthdate&"','"&Birthyear&"','"&Zip&"','"&Alt_email&"')"
一个或几个插入,把不匹配的字段找出来.

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧