文件如下: <%@ Language=VBScript %> <% dim time_star,time_end,times if Not IsEmpty(Request.Form("submit")) then time_star=Timer() name=Request.Form("name") password=Request.Form("password") if proc_login(name,password)=1 then time_end=Timer() times=time_end-time_star message="验证成功,执行时间为:"×&"秒</font>" else time_end=Timer() times=time_end-time_star message="验证失败,执行时间为:"×&"秒</font>" end if end if %> <HTML> <HEAD> <meta http-equiv="Content-Language" content="zh-cn"> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY> <table align="center" border="0" width="339" id="table2"> <tr> <td><%=message%></td> </tr> </table> <table align="center" border="1" width="465" cellspacing="1" id="table1" height="130" style="border-collapse: collapse" bordercolor="#CCFFFF"> <form action="" method="post"> <tr> <td bgcolor="#CCFFFF" colspan="2" align="center">用户登陆</td> </tr> <tr> <td bgcolor="#CCFFFF" width="179">用户名:</td> <td><input type="text" name="name" size="20" maxlength="30"></td> </tr> <tr> <td bgcolor="#CCFFFF" width="179">密 码:</td> <td><input type="text" name="password" size="20" maxlength="30"></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="提 交" name="submit"> <input type="button" value="取 消" name="B2"></td> </tr> </form> </table> </BODY> </HTML> <% function proc_login(username,pwd) Set conn=Server.CreateObject("ADODB.Connection") conn.Open "PROVIDER=SQLOLEDB;DATA SOURCE=wu;UID=sa;PWD=sa;DATABASE=meng" Set cmd = Server.CreateObject("ADODB.Command") Set cmd.ActiveConnection=conn cmd.CommandType =adCmdStoredProc cmd.CommandText="userlogin" cmd.Parameters.Append cmd.CreateParameter("@username",adVarChar,adParamInput,30,username) cmd.Parameters.Append cmd.CreateParameter("@password",adVarChar,adParamInput,30,pwd) cmd.Parameters.Append cmd.CreateParameter("ret",adInteger,adParamOutput) cmd.Execute proc_login=cmd("ret") cmd.Cancel conn.Close Set conn=Nothing end function %> 存储过程如下: use meng
CREATE PROCEDURE userlogin @username varchar(30), @password varchar(30), @islogin int output AS if exists(select * from denglu where Name=@username and pow=@password) set @islogin=1 else set @islogin=0 错误类型如下:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
ADODB.Command
变量或者类型不正确,或者不在可以接受的范围之内,要不就是与其他数据冲突。
/lianxi/proc/login.asp,行57