javascrpt调试错误0x800A03EC
ASP服务器发现运行时错误:
错 误 码:0x800A03EC
错误代码:cn.open "Driver={SQL Server}; Server=PC-201008041235\MYSQLSERVER; Database=users; UID=sa; PWD=;"
错误描述:缺少 ';'
反复了一上午没有解决,崩溃了,请大神帮忙,多谢
<HTML>
<BODY bgcolor='000000' text='ffffff'>
<FONT Face='tahoma' color='ffffff'>
<STYLE>
p { font-size=20pt ! important}
font { font-size=20pt ! important}
h1 { font-size=64pt ! important}
</STYLE>
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<%
function trace(str) {
if(Request.form("debug") == "true")
Response.write(str);
}
function Login(cn) {
var username;
var password;
username = Request.form("username");
password = Request.form("password");
var rso = Server.CreateObject("ADODB.Recordset");
var sql = "select * from users where username = '" + username + "' and password = '" + password + "'"; trace("query: " + sql );
rso.open(sql, cn);
if (rso.EOF) {
rso.close();
%>
<FONT Face='tahoma' color='cc0000'>
<H1> <BR>
<CENTER>登陆失败</CENTER>
</H1>
</BODY>
</HTML>
<% Response.end()
return;
}
else {
Session("username") = "" + rso("username");
%>
<FONT Face='tahoma' color='00cc00'>
<H1> <CENTER>登陆成功<BR>
欢迎,<% Response.write(rso("Username")); Response.write( "</BODY></HTML>" ); Response.end()
return;
}
}
function Main() {
var username
var cn = Server.createobject( "ADODB.Connection" )
cn.connectiontimeout = 20
connstr = "Driver={SQL Server}; Server=PC-201008041235\MYSQLSERVER; Database=users; UID=sa; PWD=;"//
cn.open (connstr)
username = new String(Request.form("username"))
if(username.length > 0) {
Login(cn);
}
cn.close();
}
Main();
%>
------解决方案--------------------服务器端建议使用VBScript比较方便。
js是严格区分大小写的,比如Response.Write(),Request.Form,Server.Createobject,cn.Open等等
------解决方案--------------------发你修改过的代码看看,是不是有其他没修改到的地方
------解决方案--------------------少了()