asp JavaScript数据库的连接

来源:百度知道 编辑:UC知道 时间:2024/05/26 20:23:07
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0xcc8 Thread 0xe60 DBC 0x19ab98c Jet'。
/Odbc_connection.asp, 第 9 行
数据库的连接部分程序代码是:
username=request("UserID")
if session("UserID")<>username then
response.write"<script>alert('非法登陆!');location='index.asp'</script>"
end if
strsql="select * From userinfo Where username='"&username&"'"
set rs=db.execute(strsql)
请问这里怎样修改?

是不是把VBscript代码改为Javascript代码??
如下:

username = Request("UserID")
if(Session("UserID") != username)
{
Response.Write("<script>alert('非法登陆!');location='index.asp'</script>");
}
strsql = "select * From userinfo Where username='" + username + "'";
var rs = db.execute(strsql);