asp 类型转换错误 注册页面

来源:百度知道 编辑:UC知道 时间:2024/06/07 03:01:15
<%'判断用户输入完整数据的时候进行后面的操作
if customer_name<>""and password<>""and address<>""and tel<>""and zip<>""and email<>""then
'判断密码一致
if password=password2 then
'给SQL语句的字符串赋
sql="insert customers values('"&customer_name&"','"&password&"','"&tel&"','"&address&"','"&zip&"','"&email&"')"
set cn=Server.CreateObject("ADODB.Connection")
cn.open"DSN=bookstore;UID=sa;PWD="
set rs=Server.CreateObject("ADODB.Recordset")
'使用电子邮箱区分用户,检查用户是否注册
rs.open "select customer_id from customers where email='"&email&"'",cn,3
'用户不存在
if rs.eof then
rs.close
rs.open sql,cn
rs.open "select customer_id from customers where customer_name='"&custome

错误应该是发生在这句上吧?rs.open sql,cn

检查sql="insert customers values('"&customer_name&"','"&password&"','"&tel&"','"&address&"','"&zip&"','"&email&"')"

这句是否对应表里面的东西,按这种格式写
sql="insert customers(customer_name,password,tel,address,zip,email) values('"&customer_name&"','"&password&"','"&tel&"','"&address&"','"&zip&"','"&email&"')"