错误类型:ADODB.Recordset (0x800A0BB9) 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突

connection/conn.asp<%//FileName="Connection_ado_conn_string.htm"//Type="ADO"//Designt... connection/conn.asp
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_conn_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("/data/Db.mdb")
%>

index.asp内容
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
var Recordset1_cmd = Server.CreateObject ("ADODB.Command");
Recordset1_cmd.ActiveConnection = MM_conn_STRING;
Recordset1_cmd.CommandText = "SELECT * FROM News order by Id desc";
Recordset1_cmd.Prepared = true;

var Recordset1 = Recordset1_cmd.Execute();
var Recordset1_numRows = 0;
%>
<%
var Recordset2_cmd = Server.CreateObject ("ADODB.Command");
Recordset2_cmd.ActiveConnection = MM_conn_STRING;
Recordset2_cmd.CommandText = "SELECT * FROM statement ORDER BY Id DESC";
Recordset2_cmd.Prepared = true;

var Recordset2 = Recordset2_cmd.Execute();
var Recordset2_numRows = 0;
%>
<%
var Recordset3_cmd = Server.CreateObject ("ADODB.Command");
Recordset3_cmd.ActiveConnection = MM_conn_STRING;
Recordset3_cmd.CommandText = "SELECT * FROM tVote ORDER BY id DESC";
Recordset3_cmd.Prepared = true;

var Recordset3 = Recordset3_cmd.Execute();
var Recordset3_numRows = 0;
%>
谢谢各位高手帮忙解决一下

我按照sclimit写的修改了,还是同样的错误呀,谢谢,再帮忙看看啊
展开
 我来答
sclimit
2009-04-28
知道答主
回答量:35
采纳率:0%
帮助的人:0
展开全部
connection/conn.asp
文件里没有定义server.CreateObject("ADODB.Connection")
应该是:
var MM_conn_STRING
set MM_conn_STRING = server.CreateObject("ADODB.Connection")
MM_conn_STRING.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/data/Db.mdb")

参考资料: http://tech.idweb.cn

百度网友692c76e6b
2009-05-05 · TA获得超过537个赞
知道小有建树答主
回答量:401
采纳率:0%
帮助的人:0
展开全部
连接字符串不对。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式