从没遇到过的问题 高手进 在线等
登陆 运行后 出现错误[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1。
代码如下: <%@ page contentType= "text/html; charset=gb2312 " %>
<%@ page import= "java.sql.* " %>
<html>
<head>
<script language= "javascript " type= "text/javascript ">
<!--
function onClick()
{
this.location.replace( "register.jsp ");
}
-->
</script>
<title> 用户登录 </title>
<style type= "text/css ">
<!--
.STYLE2 {color: #000000}
.STYLE3 {font-size: x-large}
-->
</style>
</head>
<body>
<%
try
{
String strId= " ";
String strName= " ";
String strPassword= " ";
String strMsg= " ";session.setAttribute( "loginId ", " ");
strId=request.getParameter( "id ");
strPassword=request.getParameter( "password ");
if(strId!=null && strPassword!=null && !strId.equals( " ")&&!strPassword.equals( " "))
{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
Connection con=DriverManager.getConnection( "jdbc:odbc:yunshu ");
Statement statement=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=null;
String String_SQL= "select id from gly where id= ' "+strId+ " ' and password= ' "+strPassword+ " ' ";
rs=statement.executeQuery(String_SQL);
if(!rs.next())
{
strMsg= "你输入的用户名或密码不正确,请重新输入! ";
out.println( "123 "+strMsg);
%>
<script language= "javascript " type= "text/javascript ">
<!--
alert( &qu