Microsoft VBScript 运行时错误 (0x800A01A8) 缺少对象: ''
<%dimdb,conn,connstrdb="maindata.mdb"setconn=Server.CreateObject("ADODB.Connection")c...
<%
dim db,conn,connstr
db="maindata.mdb"
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
dim strSql,rs,strSqll
strSql="Select * from user"
dim a1,a2,b2,c2,a3,a4,a5,a6,i
a1=Request.Form("user")
a2=Request.Form("password")
b2=Request.Form("password2")
a3=Request.Form("sex")
a4=Request.Form("like")
a5=Request.Form("career")
a6=Request.Form("intro")
if trim(a1)="" or trim(a2)="" then
Response.Write "用户名、密码必须填写!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
do while not rs.Eof 提示这个地方缺少对象
i=rs("username")
if trim(a1)=trim(i) then
Response.Write "用户名已经存在!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
rs.movenext
loop
if a2 <> b2 then
Response.Write "密码不一致!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
c2=encrypt(a2)
strSql="insert into user(username,password,password2,sex,like,career,intro,adddate) Values('"& a1 &"','"& a2 &"','"& a3 &"','"& a4 &"','"& a5 &"','"& a6 &"','"& now() &"')"
db.Execute(strSql)
Response.Write "注册成功!"
%>
<table width="121" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td align="center">
<script language="javascript">
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">关闭本窗口</a>
</td></tr>
</table> 展开
dim db,conn,connstr
db="maindata.mdb"
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
dim strSql,rs,strSqll
strSql="Select * from user"
dim a1,a2,b2,c2,a3,a4,a5,a6,i
a1=Request.Form("user")
a2=Request.Form("password")
b2=Request.Form("password2")
a3=Request.Form("sex")
a4=Request.Form("like")
a5=Request.Form("career")
a6=Request.Form("intro")
if trim(a1)="" or trim(a2)="" then
Response.Write "用户名、密码必须填写!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
do while not rs.Eof 提示这个地方缺少对象
i=rs("username")
if trim(a1)=trim(i) then
Response.Write "用户名已经存在!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
rs.movenext
loop
if a2 <> b2 then
Response.Write "密码不一致!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
c2=encrypt(a2)
strSql="insert into user(username,password,password2,sex,like,career,intro,adddate) Values('"& a1 &"','"& a2 &"','"& a3 &"','"& a4 &"','"& a5 &"','"& a6 &"','"& now() &"')"
db.Execute(strSql)
Response.Write "注册成功!"
%>
<table width="121" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td align="center">
<script language="javascript">
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">关闭本窗口</a>
</td></tr>
</table> 展开
展开全部
大哥你没连接数据表 不错误才怪呢
以下是修改好的
<%
dim db,conn,connstr
db="maindata.mdb"
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
dim strSql,rs,strSqll
strSql="Select * from user"
dim a1,a2,b2,c2,a3,a4,a5,a6,i
a1=Request.Form("user")
a2=Request.Form("password")
b2=Request.Form("password2")
a3=Request.Form("sex")
a4=Request.Form("like")
a5=Request.Form("career")
a6=Request.Form("intro")
if trim(a1)="" or trim(a2)="" then
Response.Write "用户名、密码必须填写!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, conn, 1, 3
do while not rs.Eof 提示这个地方缺少对象
i=rs("username")
if trim(a1)=trim(i) then
Response.Write "用户名已经存在!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
rs.movenext
loop
if a2 <> b2 then
Response.Write "密码不一致!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
c2=encrypt(a2)
strSql="insert into user(username,password,password2,sex,like,career,intro,adddate) Values('"& a1 &"','"& a2 &"','"& a3 &"','"& a4 &"','"& a5 &"','"& a6 &"','"& now() &"')"
conn.Execute(strSql)
Response.Write "注册成功!"
%>
<table width="121" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td align="center">
<script language="javascript">
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">关闭本窗口</a>
</td></tr>
</table>
以下是修改好的
<%
dim db,conn,connstr
db="maindata.mdb"
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
dim strSql,rs,strSqll
strSql="Select * from user"
dim a1,a2,b2,c2,a3,a4,a5,a6,i
a1=Request.Form("user")
a2=Request.Form("password")
b2=Request.Form("password2")
a3=Request.Form("sex")
a4=Request.Form("like")
a5=Request.Form("career")
a6=Request.Form("intro")
if trim(a1)="" or trim(a2)="" then
Response.Write "用户名、密码必须填写!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, conn, 1, 3
do while not rs.Eof 提示这个地方缺少对象
i=rs("username")
if trim(a1)=trim(i) then
Response.Write "用户名已经存在!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
rs.movenext
loop
if a2 <> b2 then
Response.Write "密码不一致!"
Response.Write "<a href='login.asp'>重填</a>"
Response.End
end if
c2=encrypt(a2)
strSql="insert into user(username,password,password2,sex,like,career,intro,adddate) Values('"& a1 &"','"& a2 &"','"& a3 &"','"& a4 &"','"& a5 &"','"& a6 &"','"& now() &"')"
conn.Execute(strSql)
Response.Write "注册成功!"
%>
<table width="121" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td align="center">
<script language="javascript">
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">关闭本窗口</a>
</td></tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询