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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot update. Database or object is read-only. ??

Status
Not open for further replies.

trojan800

Programmer
Nov 27, 2001
53
0
0
US
I am creating an asp page that updates a users personal data in an access database. I can query the database with no problems. But when I try to update I get the following error:
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.

My code to open the database is as follows (and has worked for me in the past):
adOpenForwardOnly = 0
adOpenStatic = 1
adOpenDynamic = 2
adLockReadOnly = 1
adLockOptimistic = 3
adCmdText = 0
adCmdTable = 2
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open DBProvider & DataSource & SecurityInfo
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "writers_tbl", conn, adOpenDynamic, adLockOptimistic, adCmdTable
rs.MoveFirst

writerID = Request.Form("writerID")

if writerID = "" then
response.redirect "frame.asp?page_id=9&Err=2"
end if

rs.Find "ID LIKE '" & writerID & "' "

if not rs.eof then

strA = Request.Form("fname")
if strA <> &quot;&quot; then rs(&quot;writer_fname&quot;) = strA

'etc....

I just recently switched over to XP professional from win2K. And this is when the problem arose. Actually I am getting this same error for past code that is proven to work. Am I missing some permissions settings somewhere? I am a complete newbie to XP. Maybe IIS (this error is coming from my machine as I am currently testing code on my machine). Any ideas or suggestions are greatly appreciated. TIA - Rory
 
1. Make sure that the mdb file is not set to Read Only.
2. Make sure the IUSER_YOURMACHINENAME has write permissions to the mdb.

Hope this helps.

-cheng
 
also there was an issue that i ran into with old AC97 files that makes the DB readonly when trying to access it thru 2k mdac

hope it helps
 
Ok so I still have not resolved this problem. But I thought that it had to be some permissions setting on my computer so I just continued on and thought the problem would go away when I uploaded the site to the server. However it did not. So this makes me think there is a problem with the database? Is it possible that some conflict came about because I am building the db with access 2000 on XP professional? Any ideas? I am in desperate need of a solution as my deadline is today. Thanks in advance for any help. -Rory
 
Sorry, jumped the gun on that last post. It does work on the server, so disregard that last post. However if anyody has any ideas why it is coming up read-only on my machine please, help! Thanks -Rory
 
I would like to know the answer to this question also. I noticed that all directories and files in the web directory c:\inetput\ are all flagged as read only when I check the properties by right clicking and looking at properties of the folder.
The problem is, if I uncheck the read only, it never saves it and keeps it as read only. Once I moved the .mdb file to a folder outside of the web root, it worked fine since I could change it from read only. Is this a bug with Win XP Pro or IIS 5.1 or perhaps a setting that I just can't find?
Has anyone else run into this problem?
 
Check to see if the folder is set to read only, it could be that an application you have or somehting has set your entire web directory to read-only. Although I don't think it's a problem with XP systems, I remember earlier ones always set files to read-only if you copied them from CD.

-Tarwn

[sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Do you know how hot your computer is running at home? I do
 
the folders resetting the permissions might have one of the following reasons causing it :

inherent permissions from tree structure above it

frontpage extentions / security

when modifying permissions not logged in as administrative user

check the actual file's permissions not the folder

when changing the folder permissions might want to check if it's also modifying the files and or subfolders ( if that's what you're trying to do

also, as a side note, i would recommend against residing an access DB in the root structure due to security issues, all you have to do is fire off an ADO error and someone could attempt to download the DB cause it's accessible in the web structure, move it to a non web based data folder and if your clients need to download it, use a virtual directory with NTLM security or something.

just suggestions, and hope the info helps.
 
I was logged in as an Administrator and was trying to change the permissions on the entire root tree. It was an XP glitch.

Rebooting the computer cleared up the problem. For whatever reason, Win XP Pro wouldn't change them. Perhaps it was because I had just installed IIS and didn't reboot the computer afterwards. Although it shouldn't have been required.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top