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

  • Question

  • User-1571941449 posted

    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!!

    Saturday, September 8, 2007 6:27 AM

Answers

  • User-1853252149 posted

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

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, September 8, 2007 11:30 AM
  • User-1571941449 posted

    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.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, September 8, 2007 2:38 PM

All replies

  • User-1853252149 posted

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

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, September 8, 2007 11:30 AM
  • User-1571941449 posted

    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?

    Saturday, September 8, 2007 2:03 PM
  • User-1571941449 posted

    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.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, September 8, 2007 2:38 PM
  • User488544618 posted

    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?

    Friday, January 18, 2008 1:39 PM
  • User989702501 posted

    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

    Sunday, January 20, 2008 10:36 PM