Results 1 to 13 of 13

Thread: need help with ado error (read only)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member bsw2112's Avatar
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    292

    need help with ado error (read only)

    hello
    i don't know what is going on with my code
    i am trying to add a new record to an access db table and i am getting this error

    *****************

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.

    *****************

    i manualy inserted two records and was able to read them back so i know the conenction is fine.

    the line that gives me the error i think is the the objRS.AddNew
    and i think the culprit is this line
    objRS.open SQL,MyConn,adOpenDynamic,adLockOptimistic,adCmdText



    this my code


    set objRS = server.createobject("ADODB.recordset")
    objRS.open SQL,MyConn,adOpenDynamic,adLockOptimistic,adCmdText


    'here is my output of the two records i manualy inserted in the databse


    response.write objRS ("q1")
    objRS .movenext
    response.write objRS ("q1")

    ' this is the area that causes the error because when when i comment these three lines the error is gone

    objRS.AddNew
    objRS ("q1") = "some string"
    objRS.Update



    'closing down now
    objRS .close
    set objRS = nothing
    please does anyone have any suggestions as to how i can make this work? it looks easy but i just don't get it.
    in the meantime i will study the parameter settings for the
    open method of a recordset object

    thanks in advance

    bsw
    Last edited by bsw2112; Dec 3rd, 2003 at 05:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width