level 1
mozun510
楼主
代码:
<html>
<head>
<title>管理员系统</title>
</head>
<body>
<table width="650" height="442" border="0" align="center" cellspacing="0">
<tr><td height="238"> </td>
<td align="center" valign="middle" background="images/admin.jpg">
<form id="form1" name="form1" method="post" >
用户名:
<input name="f_user" type="text" id="f_user" />
<br />
密 码:
<input name="f_code" type="password" id="f_code" />
<br />
<input type="submit" name="Submit" value="登录" />
</form>
</tr>
</table>
<%
dim conn
dim connstr
dim db
db="db1.mdb"
connStr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
dim username
dim userpwd
username=request.Form("f_user")
userpwd=request.form("f_code")
dim sql
sql="select * from admin where username='"&username&"' and userpwd='"&userpwd&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.recordcount<0 then
response.Write("<script language='JavaScript'>alert('用户名或密码错误!!请重新登录!');history.go(-1);</script>")
else %>
<a href="xiugai.asp"><%response.write"登录成功!"%></a>
<%end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body
</html>
出错提示为:Microsoft JET Database Engine 错误 '80040e07'标准表达式中数据类型不匹配。行 35
谢谢大神帮我解决哦
2015年06月03日 10点06分
1
<html>
<head>
<title>管理员系统</title>
</head>
<body>
<table width="650" height="442" border="0" align="center" cellspacing="0">
<tr><td height="238"> </td>
<td align="center" valign="middle" background="images/admin.jpg">
<form id="form1" name="form1" method="post" >
用户名:
<input name="f_user" type="text" id="f_user" />
<br />
密 码:
<input name="f_code" type="password" id="f_code" />
<br />
<input type="submit" name="Submit" value="登录" />
</form>
</tr>
</table>
<%
dim conn
dim connstr
dim db
db="db1.mdb"
connStr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
dim username
dim userpwd
username=request.Form("f_user")
userpwd=request.form("f_code")
dim sql
sql="select * from admin where username='"&username&"' and userpwd='"&userpwd&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.recordcount<0 then
response.Write("<script language='JavaScript'>alert('用户名或密码错误!!请重新登录!');history.go(-1);</script>")
else %>
<a href="xiugai.asp"><%response.write"登录成功!"%></a>
<%end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body
</html>
出错提示为:Microsoft JET Database Engine 错误 '80040e07'标准表达式中数据类型不匹配。行 35
谢谢大神帮我解决哦