ADODB.Recordset 错误 '800a0bb9'
ADODB.Recordset错误'800a0bb9'参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。/login.asp,行6代码:conn.asp文件<%...
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/login.asp,行 6
代码:
conn.asp文件
<%
var MM_conn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("db/db.mdb")
%>
longin.asp文件
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
var login = Server.CreateObject("ADODB.Recordset");
login.ActiveConnection = MM_conn_STRING;
login.Source = "SELECT * FROM user";
login.CursorType = 0;
login.CursorLocation = 2;
login.LockType = 1;
login.Open();
var login_numRows = 0;
%>
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("nid"));
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="";
var MM_redirectLoginSuccess="msearch.asp";
var MM_redirectLoginFailed="bmok.html";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_conn_STRING;
MM_rsUser.Source = "SELECT nid, psw";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM user WHERE nid='" + MM_valUsername.replace(/'/g, "''") + "' AND psw='" + String(Request.Form("psw")).replace(/'/g, "''") + "'";
MM_rsUser.CursorType = 0;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
在本机运行一切正常,上传到服务器后改了相对路径就不行了~~
召唤JS达人啊 展开
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/login.asp,行 6
代码:
conn.asp文件
<%
var MM_conn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("db/db.mdb")
%>
longin.asp文件
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
var login = Server.CreateObject("ADODB.Recordset");
login.ActiveConnection = MM_conn_STRING;
login.Source = "SELECT * FROM user";
login.CursorType = 0;
login.CursorLocation = 2;
login.LockType = 1;
login.Open();
var login_numRows = 0;
%>
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("nid"));
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="";
var MM_redirectLoginSuccess="msearch.asp";
var MM_redirectLoginFailed="bmok.html";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_conn_STRING;
MM_rsUser.Source = "SELECT nid, psw";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM user WHERE nid='" + MM_valUsername.replace(/'/g, "''") + "' AND psw='" + String(Request.Form("psw")).replace(/'/g, "''") + "'";
MM_rsUser.CursorType = 0;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
在本机运行一切正常,上传到服务器后改了相对路径就不行了~~
召唤JS达人啊 展开
展开全部
楼主,出现ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
只有两种情况:
第一种情况是没有调用数据库连接页面,比如<!--#include file="conn.asp"-->
第二种情况是查询条件下,没有判断if rslist.eof then这种情况
if rslist.eof then
response.redirect"需要导入的文件.asp"
end if
'800a03ec'解决方法
可能你的IIS使用Jscript作为你的默认脚本语言了,显式声明一下:
<%@ LANGUAGE=VBSCRIPT %>
<%
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../database/sanhe_data.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
function changechr(str)
changechr=replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")
response.write changechr
end function
function changechr1(str)
changechr1=replace(replace(replace(str,"<","<"),">",">"),"<br>",chr(13))
response.write changechr1
end function
晕晕,怎么又换了....
换个机器拖吧
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
只有两种情况:
第一种情况是没有调用数据库连接页面,比如<!--#include file="conn.asp"-->
第二种情况是查询条件下,没有判断if rslist.eof then这种情况
if rslist.eof then
response.redirect"需要导入的文件.asp"
end if
'800a03ec'解决方法
可能你的IIS使用Jscript作为你的默认脚本语言了,显式声明一下:
<%@ LANGUAGE=VBSCRIPT %>
<%
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../database/sanhe_data.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
function changechr(str)
changechr=replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")
response.write changechr
end function
function changechr1(str)
changechr1=replace(replace(replace(str,"<","<"),">",">"),"<br>",chr(13))
response.write changechr1
end function
晕晕,怎么又换了....
换个机器拖吧
参考资料: www.esocr.com
展开全部
先打开数据库试试
var conn=server.createobject("ADODB.connection");
conn.open(MM_conn_STRING);
var conn=server.createobject("ADODB.connection");
conn.open(MM_conn_STRING);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
conn.asp文件
<%
on error resume next
var MM_conn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("db/db.mdb")
set MM_conn_STRING =server.createobject("ADODB.CONNECTION")
%>
再试试。。。
<%
on error resume next
var MM_conn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("db/db.mdb")
set MM_conn_STRING =server.createobject("ADODB.CONNECTION")
%>
再试试。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2009-03-06
展开全部
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
'==============================================================
出现上述错误的原因:
1.楼主在ASP纲页文件中,运用了ASP保留字user(login.Source = "SELECT * FROM user";
),把db资料库中表的user表名,换为其它名称试试.
2.资料库中是否有满足条件的资料,若没有也会显示这样的错误提示.
3.是否正确调用资料库连接的代码(查看路径及代码)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
'==============================================================
出现上述错误的原因:
1.楼主在ASP纲页文件中,运用了ASP保留字user(login.Source = "SELECT * FROM user";
),把db资料库中表的user表名,换为其它名称试试.
2.资料库中是否有满足条件的资料,若没有也会显示这样的错误提示.
3.是否正确调用资料库连接的代码(查看路径及代码)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询