日期:2014-05-17  浏览次数:20843 次

菜鸟的困惑
各位大虾们,帮忙看下这个代码:
<html>
<body>
<center>
<!--#include   file= "conn.asp "-->
<%
set   rstemp=server.createobject( "adodb.recordset ")
dim   strname,strpassword,sql
strname=request.form( "name ")
strpassword=request.form( "password ")
sql "select   *   from   User   where   Username= "&   strname   & " "
rstemp.open   sql,conn,1,3

if   strname= " "then
response.write "帐号不能为空 <p> </p> "
%>
<a   href=javascript:history.back()> 上一页 </a>
<%
response.end
end   if
if   strpassword= " "then
  response.write "密码不能为空 <p> </p> "
%>
<a   href=javascript:history.back()> 上一页 </a>
<%
response.end
end   if

if   rstemp.RecordCount=1   then
  if   rstemp( "Userpassword ")=strpassword   then
session( "name ")=strname
response.write   "你好! "
else
%>
<a   href=javascript:history.back()> 密码错误   请重新输入 </a>
<%
  end   if  
else
%>
<a   href=javascript:history.back()> 帐号错误   请重新输入 </a>
<%
response.end
end   if  
rstemp.close
set   rstemp=nothing
%>
</body>
</html>
还有conn.asp大代码是:
<%
dim   mymdb:mymdb= "BBS.mdb "
set   conn=server.createobject( "adodb.connection ")
conn.open   "provider=microsoft.jet.oledb.4.0; "   &   "data   source   =   "   &   server.mappath(mymdb)
%>

到底是那出错了,他总是提示:Microsoft   VBScript   运行时错误   错误   '800a000d '     类型不匹配       /login.asp,行   10  
我上网找了一下,说是需要安装一个东西,但是我下载后,安装。他又提示说你需要安装server   parc   1.在下初学,希望各位大侠们多多关照。

小弟在这先谢谢了`!

------解决方案--------------------
嗯,那就是另外一个文件的问题了~``你没给出来~
------解决方案--------------------
sql = "select * from [User] where [Username]= ' "& strname & " ' "

这样再错就....不知道了..