CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • ADODB.Command error '800a0bb9' Arguments are of the wrong type

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    3
  • Date Created
    Sunday, September 26, 2010
  • Last Updated
    Wednesday, November 17, 2010
  • This Article Has been Viewed
    6903 times
  • Short Desc
    If you spell your connection string name incorrectly.
  • Details
    When you write out your database connection string, sometimes you will leave out a letter when writting it back out to the sql statement.

    The error that you get is:

     
    ADODB.Command error '800a0bb9'
    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    /MyFile.asp, line 114
  • Recreate Issue
    Lets say that you have this as your connection string

    <%
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath ("cffkb.mdb") & ";"
    objConn.Open
    %>


    Now
    you write out your sql parameter statement (or) simple sql query depending on the type of programmer that you are.


    <%
    Set sql = CreateObject("ADODB.Command")
    sql.ActiveConnection=objCon ' This is the Connection Name.
    sql.Prepared = true
    sql.commandtext="select column1 from table1"
    set rsGet = sql.execute
    %>



    As you see in the above line sql.ActiveConnection=objCon
    The connection name is missing the last remaining n
  • Resolve Issue
    To correct the issue.

    <%
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath ("cffkb.mdb") & ";"
    objConn.Open
    %>



    <%
    Set sql = CreateObject("ADODB.Command")
    sql.ActiveConnection=objConn ' This is the Connection Name.
    sql.Prepared = true
    sql.commandtext="select column1 from table1"
    set rsGet = sql.execute
    %>


    As you see, the connection object name is spelled objConn not objCon
    So make sure that you spell your connection object name correctly.