连接问题?
一个asp的程序,运行到newsrs.open newssql,conn这一步的时候会出现错误,Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/index.asp, line 187
大家帮我看看这是什么原因造成的?如何解决呢,谢谢了
问题点数:100、回复次数:6Top
1 楼wangtiecheng(不知不为过,不学就是错!)回复于 2006-06-01 12:43:50 得分 30
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
检查conn变量定义的位置,一般把Connection的定义放在最开始。
Top
2 楼itblog(Just for wife!)回复于 2006-06-01 12:43:58 得分 10
把index.asp代码贴出来Top
3 楼zmappleme(@苹果芯`)回复于 2006-06-01 15:26:04 得分 0
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=SQLOLEDB.1;Data Source=" & Application("DBserver") &";User Id=" & Application("DBuserid") & ";Password=" & Application("DBPw") & ";Initial Catalog=" & Application("DBname")
%>
上面是定义conn的吧?
下面就是index.asp的186,187行
newssql="select * from xxx where xxx"
newsrs.open newssql,conn
我听人说是因为这个连接是oledb,而服务器只支持odbc引起的,是不是这个原因呢?如果是的话,怎么才能解决掉?谢谢Top
4 楼zmappleme(@苹果芯`)回复于 2006-06-01 17:58:11 得分 0
帮我看看吧,各位大哥Top
5 楼Reeezak(坚持信念)回复于 2006-06-01 19:09:00 得分 30
conn.open "Driver={SQL Server};Server=" & Application("DBserver") & ";Database=" & Application("DBname") & ";Uid=" & Application("DBuserid") & ";Pwd=" & Application("DBPw")
ODBC的连接字符串Top
6 楼Mars_ZHOU()回复于 2006-06-01 20:51:05 得分 30
newssql="select * from xxx where xxx"
把这句代码完整的发出来,错误应该出在其中Top




