|
 |
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 .
|
 |
|
|
 |
|

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
|
|
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.

|

February 16th, 2004, 02:15 PM
|
 |
Wrox Author
Points: 72,055, Level: 100 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
|
|
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.
|

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
|
|
I have only set the permissions on the database.
How do you set the IUSER permissions.
|

February 17th, 2004, 04:45 AM
|
 |
Wrox Author
Points: 72,055, Level: 100 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
|
|
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.
|

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
|
|
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.
|

February 17th, 2004, 05:30 AM
|
 |
Wrox Author
Points: 72,055, Level: 100 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
|
|
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.
|

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
|
|
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)
|

February 17th, 2004, 06:07 AM
|
 |
Wrox Author
Points: 72,055, Level: 100 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
|
|
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.
|

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
|
|
Thanks for your help it was the IIs settings on the server.
Thanks again.:D
|

February 17th, 2004, 08:26 AM
|
 |
Wrox Author
Points: 72,055, Level: 100 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
|
|
Pfew, glad it worked out.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |