« Previous Next »

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

Last post 01-20-2008 10:36 PM by qbernard. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 09-08-2007, 6:27 AM

    • peaknext
    • Not Ranked
    • Joined on 09-08-2007, 9:47 AM
    • Posts 3

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

    Hello,

    This is my first post on this forum. I've got some problems on my classic ASP code and I have partially resolved. But there is still an error. It occurs everytime I try to add or update some field in my Access 2003 database. The ASP codes work well on WindowsXP + IIS 5 but when I transfer them to Windows Vista Ultimate + IIS 7, the codes always generate 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 have tried:

    • change permission of IIS_IUSR on the Access database file and folder to had full control
    • turn off read-only of the folder's and file's property
    • %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/applicationPools -applicationPoolDefaults.processModel.loadUserprofile:false

    and it's still not work

    My code :

    <%
    prefix = request.Form("prefix")
    ptName = request.Form("name")
    ptSurname = request.Form("surname")
    ptAge = request.Form("age")
    ptHomeNo = request.Form("homeNo")
    ptMoo = request.Form("moo")
    ptTambon = request.Form("tambon")
    ptAmpue = request.Form("ampue")
    ptChangwat = request.Form("changwat")

    set con = server.CreateObject("ADODB.Connection")
    con.open "myClinic" 'my system DSN
    set rec = server.CreateObject("ADODB.Recordset")
    rec.open "ptData", con, 1, 3
    rec.AddNew
    rec("prefix") = prefix
    rec("ptName") = ptName
    rec("ptSurname") = ptSurname
    rec("ptAge") = ptAge
    rec("ptHouseNum") = ptHomeNo
    rec("ptMoo") = ptMoo
    rec("ptTambon") = ptTambon
    rec("ptAmpue") = ptAmpue
    rec("ptChangwat") = ptChangwat
    rec.Update
    rec.close
    set rec = nothing
    con.close
    set con = nothing
    %>

    Thanks a lot for every comment!!

  • 09-08-2007, 11:30 AM In reply to

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

    First, are you certain the file is being accessed by the IUSR account?  FileMon will help track this.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 09-08-2007, 2:03 PM In reply to

    • peaknext
    • Not Ranked
    • Joined on 09-08-2007, 9:47 AM
    • Posts 3

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

    I had run the ProcMon just follow your suggestion and found :

    7714 0:47:20.1601814 w3wp.exe 3212 CreateFile C:\inetpub\wwwroot\myClinic\myClinic.mdb ACCESS DENIED Desired Access: Generic Read/Write, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Random Access, Open No Recall, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a, Impersonating: NT AUTHORITY\IUSR

    Is this important and may it be the cause, please?

  • 09-08-2007, 2:38 PM In reply to

    • peaknext
    • Not Ranked
    • Joined on 09-08-2007, 9:47 AM
    • Posts 3

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

    OK, I finally can solve the problem. The cause is that no IUSR in Security Setting so IUSR cannot access the  database file(s). All I have done is add new IUSR and set its permission, and the error just disappeared. Thanks a lot to Jeff for helping me through. There's a lot for me, who is newby, to learn.

  • 01-18-2008, 1:39 PM In reply to

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

    I think I have the same problem. When I try to update the ACCESS database, IIS 7 on Vista confirms it but doesn't update the database. Where do I find the security setting to add IUSR as a new user?

  • 01-20-2008, 10:36 PM In reply to

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

    Well, have you try grant iusr access permissions?
    What OP meant by add new user is 'replace the default iusr user as anonymous account with a normal user account'. the iusr acc in IIS 7 is not built-in account like localsystem, etc

    Cheers,
    Bernard Cheah
Page 1 of 1 (6 items)
Microsoft Communities