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"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & DATA_SRC
cnDB.Open
Set rsAdd = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
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"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
rsAdd("Description"
= Request.Form("txtDescription"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
rsAdd.Update
rsAdd.Close
Set rsAdd=Nothing
cbDB.Close
Set cnDB = Nothing
End Sub
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"
rsAdd("URL"
rsAdd("Description"
rsAdd.Update
rsAdd.Close
Set rsAdd=Nothing
cbDB.Close
Set cnDB = Nothing
End Sub