Help with 'Object Read Only' ERROR!

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Help with 'Object Read Only' ERROR!

    Just simple new at this..

    my setup is:

    XP Prof, running IIS
    Access 2002


    I have a simple database that I'm trying to make available via web pages..

    I can display teh contents of the page but when I write to the DB I get the
    ERROR:

    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object
    is read-only.

    ------- END of ERROR MSG -------

    My ASP code looks is:

    <%


    'Dimension variables
    Dim adoCon 'Holds the Database Connection Object
    Dim rsUpdateEntry 'Holds the recordset for the record to be updated
    Dim strSQL 'Holds the SQL query for the database
    Dim lngRecordNo 'Holds the record number to be updated

    'Read in the record number to be updated
    lngRecordNo = CLng(Request.Form("ID_no"))

    'Create an ADO connection odject
    Set adoCon = Server.CreateObject("ADODB.Connection")

    'Set an active connection to the Connection object using a DSN-less
    connection
    adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
    Server.MapPath("guestbook.mdb")

    'Set an active connection to the Connection object using DSN connection
    'adoCon.Open "DSN=guestbook"

    'Create an ADO recordset object
    Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")

    'Initialise the strSQL variable with an SQL statement to query the database
    strSQL = "SELECT tblComments.* FROM tblComments WHERE ID_no=" & lngRecordNo

    'Set the cursor type we are using so we can navigate through the recordset
    rsUpdateEntry.CursorType = 2

    'Set the lock type so that the record is locked by ADO when it is updated
    rsUpdateEntry.LockType = 3

    'Open the tblComments table using the SQL query held in the strSQL varaiable
    rsUpdateEntry.Open strSQL, adoCon

    'Update the record in the recordset
    rsUpdateEntry.Fields("Name") = Request.Form("name")
    rsUpdateEntry.Fields("Comments") = Request.Form("comments")

    'Write the updated recordset to the database
    rsUpdateEntry.Update

    'Reset server objects
    rsUpdateEntry.Close
    Set rsUpdateEntry = Nothing
    Set adoCon = Nothing

    'Return to the update select page incase another record needs deleting
    Response.Redirect "update_select.asp"
    %>

    ------- END of CODE -------


    What am I missing? is it a Access setup, security issue?

    Thanks


    Looking For Help2 Guest

  2. Similar Questions and Discussions

    1. Strange error from: Dim myState As Object() = CType(savedState, Object())
      Every book and every website I've seen that talks about how to save state for child controls in a composite webcontrol says to do something like...
    2. Mysterious Error: Object reference not set to an instance of an object
      Hi There! I'm having a mysterious error right after I login using Forms Authentication in my ASP.NET app. Below is the error... Exception...
    3. How to get out of this error message "Database or object is read-only"
      After I moved my ASP pages and an Access database from PWS in NT 4.0 to IIS 5.0 in XP Pro, I can't edit data in the database through the ASP web...
    4. Can't read Session Object
      There is no great way to share session state between ASP and ASP.NET. But that doesn't mean you don't have options. Here are some common ways:...
    5. HELP! Error Loading ASPX : Object Reference not set to an instance object
      Hello, When i run my aspx i get this weird error: System.NullReferenceException: Object reference not set to an instance of an object. at...
  3. #2

    Default Re: Help with 'Object Read Only' ERROR!


    "Looking For Help2" <dgpeter@mindspring.com> wrote in message
    news:eA9qb.2188$gn1.133812@news1.news.adelphia.net ...
    > Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    Get an OLEDB connection string from [url]www.connectionstrings.com[/url] and also read
    the page linked below.

    > [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or
    object
    > is read-only.
    [url]http://www.aspfaq.com/2009[/url]

    Ray at work


    Ray at Guest

  4. #3

    Default Re: Help with

    You have a common problem. Go into IIS and change the permission of your database file the *.mdb file should be changed from read only (DEFAULT) to read/write.

    This is a problem with web host.

    You can read but you cant write.

    After you change the file on the IIS box,
    then you can write to the access database.

    For example addnew will add a new record.

    Remember you have to change the permissions of all your *.mdb files.

    ************************************************** ********************
    Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
    Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
    cnovela3@hotmail.com Guest

  5. #4

    Default Re: Help with

    Actually, the NTFS permissions for the directory containing the .mdb file
    will have to be changed, since the pages will need to create and delete .ldb
    files in those directories.

    Ray at work

    "Carlos Novela" <cnovela3@hotmail.com> wrote in message
    news:eFa28JLpDHA.2808@TK2MSFTNGP10.phx.gbl...
    > You have a common problem. Go into IIS and change the permission of your
    database file the *.mdb file should be changed from read only (DEFAULT) to
    read/write.
    >
    > This is a problem with web host.
    >
    > You can read but you cant write.
    >
    > After you change the file on the IIS box,
    > then you can write to the access database.
    >
    > For example addnew will add a new record.
    >
    > Remember you have to change the permissions of all your *.mdb files.
    >
    > ************************************************** ********************
    > Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
    > Comprehensive, categorised, searchable collection of links to ASP &
    ASP.NET resources...


    Ray at Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139