p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access ASP (http://p2p.wrox.com/forumdisplay.php?f=104)
-   -   Database or object is read-only (http://p2p.wrox.com/showthread.php?t=9419)

ryanb February 16th, 2004 01:08 PM

Database or object is read-only
 
I am unable to "rs.addnew" to my database, the error message reads...

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

However the permissions are set to read/write for everyone.

This does not make sense.

[V]

Imar February 16th, 2004 02:15 PM

Did you set the permissions on the database or to the folder where your database is located?

The IUSR account (if you're using IIS) needs to create temporary lock files in the folder, so granting access to just the .mdb file is not enough.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ryanb February 17th, 2004 04:31 AM

I have only set the permissions on the database.

How do you set the IUSER permissions.




Imar February 17th, 2004 04:45 AM

Hi,

Open up the properties dialog for the folder that holds your database. On the security tab, click Add to add the IUSR_MachineName account (where MachineName is the name of your machine).

Make sure this account has at least Read and Write permissions.

It's important to change the settings on the folder than on the file, for the reason I mentioned earlier.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ryanb February 17th, 2004 05:19 AM

Im sorry the database is still read only?

the permissions are now set to "Everyone and IUSR_MachineName"

this is very frustrating.

I have tried to build a new database and this still does not work.




Imar February 17th, 2004 05:30 AM

Hmmm, odd.

Here are a few things to check:

1. Find out under which account IIS is running. You'll find this name on the Directory Security of the Properties dialog for your Web site. Check whether Anonymous access has been enabled or not.

2. Check that you're actually setting the permissions for the correct database. This may sound obvious, but it's important that you set the settings for the .mdb file in the scope of your Web folder (usually somewhere under Inetpub\wwwroot) and not the one you use for development.

3. Make sure you have a valid connection string to your database. Check here for info: http://www.able-consulting.com/MDAC/...orMicrosoftJet

4. Make sure your database is not password protected and that you're not trying to connect to it using a username / password combination that doesn't exist.

5. Check the ReadOnly property of the /mdb file on disk. Maybe the physical file or folder is read-only.

If all this doesn't help, I suggest you provide some info about your setup (Web server, folder, etc) and post the code for the page you're trying to run.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ryanb February 17th, 2004 05:52 AM

The files are held on a remote server, there are other databases in the same folder which do not seem to be having any difficulty.

I have copied the permissions and the database in question will still not work.

the code where it trips up is simple and is as follows.

set dbconn = server.createobject("ADODB.connection")
set rs=server.createobject("ADODB.recordset")
dbconn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:\vmweb\data\sbsdata\orders.mdb"
sqlquery = "SELECT * FROM headers"
rs.open sqlquery,dbconn,3,3
rs.movelast
recno = rs("orderno") + 1
rs.AddNew..........................(here)


Imar February 17th, 2004 06:07 AM

Well, I am almost out of ideas. The code you posted should work, so that's not causing the problem.

It has to be a permissions problem. Some, the Web server does not have permissions to access c:\vmweb\data\sbsdata\orders.mdb.
Are both IIS and the database located at the same physical server? Did you set the permissions on that server?

You can try Full Control for Everyone on the sbsdata folder, just to see if that fixes the problem. If it does, start limiting permissions until you find out what is causing the problem.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.

ryanb February 17th, 2004 08:11 AM

Thanks for your help it was the IIs settings on the server.


Thanks again.:D


Imar February 17th, 2004 08:26 AM

Pfew, glad it worked out.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


All times are GMT -4. The time now is 09:37 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.