Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database is "read only" problem

Status
Not open for further replies.

SoupXVII

Technical User
Dec 15, 2000
36
IT
The message I get when I run my ASP script is the following:

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/CO/submit.asp, line 28

I don't understand the message because the database is NOT read-only as far as I can tell. It's in a subfolder of Inetpub/ which are "read only" but Windows won't let me change that property. I change it, close the window, and when I check it again the folder is read-only again. The database file is definitely not read only.


The code I use for this purpose is the following (line 28 from the error message is rsAdd.AddNew):


Sub PrintConfirm
Dim cnDB 'ADODB.Connection
Dim rsAdd 'ADODB.Recordset
Const DATA_SRC = "Data Source=c:\Inetpub\
Set cnDB = Server.CreateObject("AdoDB.Connection")
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & DATA_SRC
cnDB.Open
Set rsAdd = Server.CreateObject("ADODB.Recordset")
rsAdd.Open "SELECT * FROM Submissions", cnDB, 1, 3

'Add a new record to the database.
rsAdd.AddNew
rsAdd("Date") = FormatDateTime(Now(), 2)
rsAdd("URL") = Request.Form("txtURL")
rsAdd("Description") = Request.Form("txtDescription")
rsAdd.Update
rsAdd.Close
Set rsAdd=Nothing
cbDB.Close
Set cnDB = Nothing
End Sub
 
You have to give the IUSR write permision on the folder to allow access write to the database.

Regards,
Durug
 
I tried it. I looked at Folder Properties from my IIS panel and - from "Directory" tab - selected "Write", which was unchecked. It didn't do anything so... I must be doing something wrong. :) I'm using Win XP Pro, if it helps any.
 
you had to go in windows explorer on the folder right click
properties --> security and there assign to the IUSR the rights.

How did you do it?
 
Through Windows Explorer... I decided to give it a try and it worked. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top