Read Only error when trying to write to Access DB

S

Stephen D Cook

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
 
B

Bob Barrows [MVP]

Stephen said:
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?
 
B

Bob Barrows [MVP]

Bob said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top