ASP Add Record Approaches

Discussion in 'ASP General' started by Matthew Louden, Sep 27, 2003.

  1. The following ASP code yields the following run-time error, I want to know
    which approaches for adding records. Using "Insert Into" statement or AddNew
    method in recordset object?? As I mentioned in previous post, when I use
    "Insert Into" SQL statement, it yields "ADODB.Recordset error '800a0e78'
    Operation is not allowed when the object is closed."

    <%
    Dim objRS
    Set objRS = Server.CreateObject ("ADODB.Recordset")
    objRS.Open "test", strConnect, adOpenStatic, adLockOptimistic, adCmdTable
    objRS.MoveLast
    objRS.AddNew ' add a new record
    objRS("id") = "9999"
    objRS("name") = "Psycho"
    objRS.Update
    objRS.Close
    Set objRS = Nothing
    %>

    ADODB.Recordset error '800a0bb9'
    Arguments are of the wrong type, are out of acceptable range, or are in
    conflict with one another.
    Matthew Louden, Sep 27, 2003
    #1
    1. Advertising

  2. Matthew Louden

    Ken Schaefer Guest

    www.adopenstatic.com/faq/800a0bb9.asp

    That said, please see answer to your previous post - you should use the SQL
    statement, but not the recordset object.

    Cheers
    Ken

    "Matthew Louden" <> wrote in message
    news:...
    : The following ASP code yields the following run-time error, I want to know
    : which approaches for adding records. Using "Insert Into" statement or
    AddNew
    : method in recordset object?? As I mentioned in previous post, when I use
    : "Insert Into" SQL statement, it yields "ADODB.Recordset error '800a0e78'
    : Operation is not allowed when the object is closed."
    :
    : <%
    : Dim objRS
    : Set objRS = Server.CreateObject ("ADODB.Recordset")
    : objRS.Open "test", strConnect, adOpenStatic, adLockOptimistic,
    adCmdTable
    : objRS.MoveLast
    : objRS.AddNew ' add a new record
    : objRS("id") = "9999"
    : objRS("name") = "Psycho"
    : objRS.Update
    : objRS.Close
    : Set objRS = Nothing
    : %>
    :
    : ADODB.Recordset error '800a0bb9'
    : Arguments are of the wrong type, are out of acceptable range, or are in
    : conflict with one another.
    :
    :
    :
    :
    Ken Schaefer, Sep 27, 2003
    #2
    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. Calvin
    Replies:
    2
    Views:
    664
    Mike Treseler
    Jul 13, 2005
  2. André
    Replies:
    0
    Views:
    3,743
    André
    Jun 25, 2006
  3. André
    Replies:
    0
    Views:
    437
    André
    Jun 25, 2006
  4. Replies:
    0
    Views:
    170
  5. Replies:
    2
    Views:
    217
Loading...

Share This Page