一个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大家帮我看看这是什么原因造成的?如何解决呢,谢谢了

解决方案 »

  1.   

    参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。检查conn变量定义的位置,一般把Connection的定义放在最开始。
      

  2.   

    <%
    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引起的,是不是这个原因呢?如果是的话,怎么才能解决掉?谢谢
      

  3.   

    conn.open "Driver={SQL Server};Server=" & Application("DBserver") & ";Database=" & Application("DBname") & ";Uid=" & Application("DBuserid") & ";Pwd=" & Application("DBPw")ODBC的连接字符串
      

  4.   

    newssql="select * from xxx where xxx"把这句代码完整的发出来,错误应该出在其中