Read Only error when trying to write to Access DB

Discussion in 'ASP General' started by Stephen D Cook, Dec 14, 2007.

  1. I am trying to write to an ACCESS database. I have full permission and
    Read/Write capability set for the database and folder. But when I get
    to MoveLast or Update, I get an error of the database is ReadOnly. I
    can open the database and add new lines, modify and delete with no
    problems, but when I run this code-behind code, I get the ReadOnly
    error. Please help.

    Dim objConn
    objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "DSN=DCTRepair"
    objConn.Open()
    Dim objRS
    objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open("TechEntry", objConn, 2, 3, 2)
    objRS.AddNew()
    objRS("SerialNumber") = TextBox1.Text
    objRS("TechNumber") = TextBox2.Text
    'objRS.MoveLast()

    objRS.Update()
    objRS.MoveFirst()

    objConn.Close()
    objConn = Nothing
    End Sub
     
    Stephen D Cook, Dec 14, 2007
    #1
    1. Advertising

  2. Stephen D Cook wrote:
    > I am trying to write to an ACCESS database. I have full permission and
    > Read/Write capability set for the database and folder. But when I get
    > to MoveLast or Update, I get an error of the database is ReadOnly. I
    > can open the database and add new lines, modify and delete with no
    > problems, but when I run this code-behind code, I get the ReadOnly
    > error. Please help.
    >
    > Dim objConn
    > objConn = Server.CreateObject("ADODB.Connection")
    > objConn.ConnectionString = "DSN=DCTRepair"
    > objConn.Open()
    > Dim objRS
    > objRS = Server.CreateObject("ADODB.Recordset")
    > objRS.Open("TechEntry", objConn, 2, 3, 2)
    > objRS.AddNew()
    > objRS("SerialNumber") = TextBox1.Text
    > objRS("TechNumber") = TextBox2.Text
    > 'objRS.MoveLast()
    >
    > objRS.Update()
    > objRS.MoveFirst()
    >
    > objConn.Close()
    > objConn = Nothing
    > End Sub


    This is ALWAYS due to file permissions problems. You say "I" have full
    permissions: does the IUSE_machinename account have those permissions?

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Dec 14, 2007
    #2
    1. Advertising

  3. Bob Barrows [MVP] wrote:
    >
    > This is ALWAYS due to file permissions problems. You say "I" have full
    > permissions: does the IUSE_machinename account have those permissions?
    >

    This should be IUSR, of course, not IUSE.
    Sometimes the IWAM_machinename account needs rights as well, depending
    on where the code is running and what your isolation setting is in IIS.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Dec 14, 2007
    #3
    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. Isaac
    Replies:
    0
    Views:
    2,466
    Isaac
    Jul 10, 2003
  2. Matt
    Replies:
    2
    Views:
    864
    Kristo
    Apr 22, 2005
  3. keithb
    Replies:
    2
    Views:
    8,024
    keithb
    Jun 7, 2006
  4. A
    Replies:
    1
    Views:
    326
    Ian Collins
    Nov 3, 2010
  5. Trans
    Replies:
    3
    Views:
    172
    Trans
    Dec 21, 2005
Loading...

Share This Page