Provider (0x80020005)类型不匹配。/2.asp, 第 13 行
<%setconn=server.createobject("adodb.connection")strconn="provider=microsoft.jet.oled...
<%
set conn=server.createobject("adodb.connection")
strconn="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("1.mdb")
conn.open strconn
set rs=server.createobject("adodb.recordset")
rs.open "select * from form1 where u_name='"&request.form("b2")&"'",conn,1,3
if not rs.eof then
userage=request.form("b2")
response.write("您好"&userage)
else
rs.addnew
rs("u_name")=request.form("b2")
rs("u_age")=request.form("b3")
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="javascript">
funtion check()
{
if(document.b1.b2.value=="")
{
alert("请填写用户名");
return false;
}
if(document.b1.b3.value=="")
{
alert("没有填写密码");
return false;
}
}
</script>
<form name="b1" action="" onSubmit="javascript:return check()" method="post">
<table border="1">
<tr>
<td>用户名</td>
<td><input type="text" name="b2" value=""></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="b3" value=""></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="登陆"> <input type="reset" value="重置"></td>
</tr>
</table>
</form>
谢谢您,重做多遍了,不行! 展开
set conn=server.createobject("adodb.connection")
strconn="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("1.mdb")
conn.open strconn
set rs=server.createobject("adodb.recordset")
rs.open "select * from form1 where u_name='"&request.form("b2")&"'",conn,1,3
if not rs.eof then
userage=request.form("b2")
response.write("您好"&userage)
else
rs.addnew
rs("u_name")=request.form("b2")
rs("u_age")=request.form("b3")
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="javascript">
funtion check()
{
if(document.b1.b2.value=="")
{
alert("请填写用户名");
return false;
}
if(document.b1.b3.value=="")
{
alert("没有填写密码");
return false;
}
}
</script>
<form name="b1" action="" onSubmit="javascript:return check()" method="post">
<table border="1">
<tr>
<td>用户名</td>
<td><input type="text" name="b2" value=""></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="b3" value=""></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="登陆"> <input type="reset" value="重置"></td>
</tr>
</table>
</form>
谢谢您,重做多遍了,不行! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询