Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 16th, 2004, 12: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.

Reply With Quote
  #2 (permalink)  
Old February 16th, 2004, 01:15 PM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,032
Thanks: 80
Thanked 1,580 Times in 1,557 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.
Reply With Quote
  #3 (permalink)  
Old February 17th, 2004, 03: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.



Reply With Quote
  #4 (permalink)  
Old February 17th, 2004, 03:45 AM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,032
Thanks: 80
Thanked 1,580 Times in 1,557 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.
Reply With Quote
  #5 (permalink)  
Old February 17th, 2004, 04: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.



Reply With Quote
  #6 (permalink)  
Old February 17th, 2004, 04:30 AM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,032
Thanks: 80
Thanked 1,580 Times in 1,557 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.
Reply With Quote
  #7 (permalink)  
Old February 17th, 2004, 04: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)

Reply With Quote
  #8 (permalink)  
Old February 17th, 2004, 05:07 AM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,032
Thanks: 80
Thanked 1,580 Times in 1,557 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.
Reply With Quote
  #9 (permalink)  
Old February 17th, 2004, 07: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

Reply With Quote
  #10 (permalink)  
Old February 17th, 2004, 07:26 AM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,032
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Pfew, glad it worked out.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01: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 12:26 PM



All times are GMT -4. The time now is 04:35 PM.


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