ASP/SQL error message

Discussion in 'ASP General' started by Micromanaged, Oct 29, 2004.

  1. Micromanaged

    Micromanaged Guest

    Getting the following error message:

    Error Type:
    ADODB.Recordset (0x800A0BB9)
    Arguments are of the wrong type, are out of acceptable range, or are in
    conflict with one another.
    /safedevelopment/Credit/FairIsaac.asp, line 20

    From this code:
    Set cn = Session("cnn")
    Set rstPhones = Server.CreateObject("ADODB.Recordset")

    'CID = Session("CID")
    'SID = Session("SID")

    if ID > -1 then
    set SQL= cn.Execute("SELECT Customers.[Company Name],
    Customers.[Address Line 1], " & _
    "Customers.[Address Line 2], Customers.City, Customers.State,
    Customers.Zip, " & _
    "Customers.[Company Phone],Customers.[Business Structure]FROM Customers
    INNER JOIN Schedule on " & _
    "Customers.[ID]=Schedule.[customer id]")

    rstPhones.Open SQL, cn, adOpenDynamic, , adCmdText
    end if

    Ideas? Pointers? Tips? on what I am doing wrong would be appreciated.

    Thanks in advance.


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, Oct 29, 2004
    #1
    1. Advertising

  2. Micromanaged

    Mike Guest

    VB script doesn't know what VB constants are, so it doesn't know what
    'adOpenDynamic' is supposed to mean.
    make an #include to 'adovbs.inc' or use the number constant instead of the
    variable.


    "Micromanaged" <> wrote in message
    news:...
    >
    >
    > Getting the following error message:
    >
    > Error Type:
    > ADODB.Recordset (0x800A0BB9)
    > Arguments are of the wrong type, are out of acceptable range, or are in
    > conflict with one another.
    > /safedevelopment/Credit/FairIsaac.asp, line 20
    >
    > From this code:
    > Set cn = Session("cnn")
    > Set rstPhones = Server.CreateObject("ADODB.Recordset")
    >
    > 'CID = Session("CID")
    > 'SID = Session("SID")
    >
    > if ID > -1 then
    > set SQL= cn.Execute("SELECT Customers.[Company Name],
    > Customers.[Address Line 1], " & _
    > "Customers.[Address Line 2], Customers.City, Customers.State,
    > Customers.Zip, " & _
    > "Customers.[Company Phone],Customers.[Business Structure]FROM Customers
    > INNER JOIN Schedule on " & _
    > "Customers.[ID]=Schedule.[customer id]")
    >
    > rstPhones.Open SQL, cn, adOpenDynamic, , adCmdText
    > end if
    >
    > Ideas? Pointers? Tips? on what I am doing wrong would be appreciated.
    >
    > Thanks in advance.
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Mike, Oct 29, 2004
    #2
    1. Advertising

  3. Micromanaged wrote:
    > Getting the following error message:
    >
    > Error Type:
    > ADODB.Recordset (0x800A0BB9)
    > Arguments are of the wrong type, are out of acceptable range, or are
    > in conflict with one another.
    > /safedevelopment/Credit/FairIsaac.asp, line 20
    >

    ..
    http://www.aspfaq.com/show.asp?id=2112

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 29, 2004
    #3
  4. > set SQL= cn.Execute("...

    Here you have a recordset object

    > rstPhones.Open SQL, cn, adOpenDynamic, , adCmdText


    The open statement doesn't expect a recordset object where you've placed it.
    Replace the two above lines with:

    set rstPhones = cn.Execute("...

    And drop the Server.CreateObject("ADODB.Recordset") line.
     
    Aaron [SQL Server MVP], Oct 29, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    827
    tshad
    Jan 27, 2005
  2. Jeremy Ames

    bad sql error message

    Jeremy Ames, Sep 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,009
    Bruce Barker
    Sep 8, 2005
  3. =?Utf-8?B?ZGVsdGFsaW1hZ29sZg==?=

    installed 2.0.50727 now I get a sql express error message

    =?Utf-8?B?ZGVsdGFsaW1hZ29sZg==?=, Dec 18, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    2,192
  4. ecoolone
    Replies:
    0
    Views:
    800
    ecoolone
    Jan 3, 2008
  5. Jack

    Error message with sql statement

    Jack, Oct 20, 2004, in forum: ASP General
    Replies:
    1
    Views:
    131
    Bob Barrows [MVP]
    Oct 20, 2004
Loading...

Share This Page