<!-- #include file="wsq/adovbs.inc" -->
<html>
<head>
<title>用户提交注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="316395" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
Dim db,conn,connstr
db="database.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.open connstr
username=request.form("username")
password=request.form("password")
email=request.form("email")
oicq=request.form("oicq")
userfrom=request.form("userfrom")
telphone=request.form("telphone")
username=replace(username,"'","''")
password=replace(password,"'","''")
email=replace(email,"'","''")
oicq=replace(oicq,"'","''")
userfrom=replace(userfrom,"'","''")
telphone=replace(telphone,"'","''")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&username&"'"
rs.open sql,conn,2,3
if rs.eof then
rs.addnew
rs("username")=username
rs("password")=password
rs("email")=email
rs("oicq")=oicq
rs("userfrom")=userfrom
rs("telphone")=telphone
conn.execute "insert into user (username,password,userfrom,email,oicq,telphone) values ('"&username&"','"&password&"','"&userfrom&"','"&email&"','"&oicq&"','"&telphone&"')"
else
msgbox="错误"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
运行到这句出现错误:conn.execute "insert into user (username,password,userfrom,email,oicq,telphone) values ('"&username&"','"&password&"','"&userfrom&"','"&email&"','"&oicq&"','"&telphone&"')"