Arguments are of the wrong type...connecting to Access DB

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thecubemonkey

    Arguments are of the wrong type...connecting to Access DB

    Hi everyone,

    I'm getting the following error:

    ADODB.Recordset error '800a0bb9'
    Arguments are of the wrong type, are out of acceptable range, or are
    in conflict with one another.
    /newsite/faq.asp, line 57

    Can you look at the code below and let me know if the problem is my
    code or if there is a server setting that needs adjustment. Thanks.

    _______________ _______________ _______________ _______________ ______________

    I am using a global.asa file with:
    SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server">

    Sub Application_OnS tart()

    Dim strConn
    strConn = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=D:\Depar tments
    \MBA_UBALT\news ite\faq.mdb"
    Application("st rConn") = strConn

    End Sub

    </SCRIPT>

    The ASP page code is:

    <%
    Dim rsFAQ
    Set rsFAQ = Server.CreateOb ject("ADODB.Rec ordset")

    rsFAQ.Open "FAQ", Application("st rConn"), adOpenKeyset,
    adLockReadOnly, adCmdText


    Do While Not rsFAQ.EOF
    Response.Write "<li><b>" & rsFAQ("Question ") & "</b>"
    Response.Write "<p>" & rsFAQ("Answer") & "</p></li>"
    rsFAQ.MoveNext
    Loop
    If rsFAQ.BOF Then
    Response.Write "<p>No FAQs in the database!</p>" & vbNewLine
    End If

    rsFAQ.Close
    %>
  • Bob Barrows [MVP]

    #2
    Re: Arguments are of the wrong type...connecti ng to Access DB

    thecubemonkey wrote:
    Hi everyone,
    >
    I'm getting the following error:
    >
    ADODB.Recordset error '800a0bb9'
    Arguments are of the wrong type, are out of acceptable range, or are
    in conflict with one another.
    /newsite/faq.asp, line 57
    >
    Can you look at the code below and let me know if the problem is my
    code or if there is a server setting that needs adjustment. Thanks.
    >
    _______________ _______________ _______________ _______________ ______________
    >
    rsFAQ.Open "FAQ", Application("st rConn"), adOpenKeyset,
    adLockReadOnly, adCmdText
    >
    This error is typically due to the failure to define those ado constants.
    See:


    That said, I have to say there is rarely a need to use other than the
    default, server-side forward-only cursor type. This statement could be
    changed to (assuming FAQ is a table in your database):

    dim cn, rs
    set cn = createobject("a dodb.connection ")
    cn.open Application("st rConn")
    set rs = cn.Execute("sel ect * from FAQ',,1)


    Further relevant reading: http://www.aspfaq.com/show.asp?id=2096



    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Comment

    Working...