Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
| Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2004, 01:08 PM
Registered User
 
Join Date: Feb 2004
Location: Sunderland, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old February 16th, 2004, 02:15 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 17th, 2004, 04:31 AM
Registered User
 
Join Date: Feb 2004
Location: Sunderland, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have only set the permissions on the database.

How do you set the IUSER permissions.



 
Old February 17th, 2004, 04:45 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 17th, 2004, 05:19 AM
Registered User
 
Join Date: Feb 2004
Location: Sunderland, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.



 
Old February 17th, 2004, 05:30 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 17th, 2004, 05:52 AM
Registered User
 
Join Date: Feb 2004
Location: Sunderland, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)

 
Old February 17th, 2004, 06:07 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 17th, 2004, 08:11 AM
Registered User
 
Join Date: Feb 2004
Location: Sunderland, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


Thanks again.:D

 
Old February 17th, 2004, 08:26 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Pfew, glad it worked out.

Imar


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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot update. Database or object is read-only. zedekiah Classic ASP Databases 1 May 2nd, 2008 09:30 AM
Update Fails - Database is Read-Only pete robinson Classic ASP Basics 3 December 19th, 2007 02:40 PM
Read only Database error larry101 Classic ASP Databases 4 September 11th, 2004 08:41 AM
permit read only while database is OPEN Belier Access 5 April 6th, 2004 08:26 PM
How to read/write Access Database jmmendes Access VBA 0 November 18th, 2003 01:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.