我同学做了一个注册的页面点击“注册”后执行
<!--#include file="adofunctions.asp"-->
<%
id=request.form("id")
sname=request.form("name")
sex=request.form("sex")
psd=request.form("psd")
chkpsd=request.form("chkpsd")
mail=request.form("mail")
address=request.form("address")
tel=request.form("tel")
post=request.form("post")
getdate=date()
if id="" or sname="" or sex="" or psd="" or chkpsd="" or mail="" or tel="" or address="" or post="" then
response.write "<script language=JavaScript>alert('请把带*的内容填写完整!');window.location.href = 'reguser.asp'; </script>"
else if psd=chkpsd then
set objrs=getrecordset("db1.mdb","user")
objrs.addnew array("id"),array(id)
objrs.update
objrs.close
set objrs=nothing
objconn.close
set objconn=nothing
response.write "<script language=JavaScript>alert('恭喜你注册成功了!请妥善保管你的用户ID和密码!');window.location.href = 'index.asp';</script>"
else
response.write "<script language=JavaScript>alert('请再确认您的密码');window.location.href = 'reguser.asp'; </script>"
end if
end if
%>
其中adofunctions.asp为
<!-- #include file ="adovbs.inc" -->
<%
dim objconn
function getrecordset(filename,tablename)
set objconn =server.createobject("adodb.connection")
objconn.connectionstring="provider=microsoft.jet.oledb.4.0;" & "data source=" & server.mappath(filename)
objconn.open
set getrecordset=server.createobject("adodb.recordset")
getrecordset.open tablename,objconn,adopenkeyset,adlockoptimistic,adcmdtable
end function
function getsqlrecordset(strsql,filename,tablename)
set objconn=server.createobject("adodb.connection")
objconn.connectionstring="provider=microsoft.jet.oledb.4.0;" & "data source=" & server.mappath(filename)
objconn.open
set getsqlrecordset=server.createobject("adodb.recordset")
getsqlrecordset.open strsql,objconn,adopenkeyset,adlockoptimistic,adcmdtext
end function
%>
错误为
Microsoft JET Database Engine (0x80040E14)
FROM 子句语法错误。
/adofunctions.asp, 第 12 行
麻烦斑竹看看,下午就要交了