Print Page | Close Window

DB or object is read only error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1834
Printed Date: 29 March 2026 at 8:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: DB or object is read only error
Posted By: swatson
Subject: DB or object is read only error
Date Posted: 15 April 2003 at 10:36am

Hi All:

I have been trying to enter data from a form, using asp, to an Access database.  I'm getting the following error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/MyWeb/add_to_db3.asp, line 52

I looked on the database error FAQ page for webwiz forums and thought I found the answer through the instructions, "checking and setting up the correct persmissions on the IIS Server" ( http://www.webwiz.net/asp/faq/server_permissions.asp - http://www.webwiz.net/asp/faq/server_permissions.asp ).  However, I can't find the "IUSR_name_of_my_computer" necessary in Step 6.  Can anyone help?

Here are my files:

add_to_db3.asp-

<html>
<head>
<title>Adding data to database</title>
</head>
<body>

Adding data to database...


<%
'Dimension variables

Dim conn
Dim rs
Dim strSQL

'Create an ADO connection object
Set conn=Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN connection
conn.Open "DSN=profiles"

'Create an ADO recordset object
Set rs=Server.CreateObject("ADODB.Recordset")

strSQL="Facility"

'Open the recordset with the SQL query
rs.Open strSQL,conn,1,3

'rs.CursorType=2
'Set the cursor type we are using so we can navigate through the recordset

'rs.LockType=3
'Set the lock type so that the record is locked by ADO when it is updated

rs.addNew
'Tell the recordset we are adding a new record to it. 

rs.Fields("Facility_id")=Request.Form("Facility_id")
rs.Fields("Facility_name")=Request.Form("Facility_name")
rs.Fields("Facility_description")=Request.Form("Facility_description")
rs.Fields("Street_address1")=Request.Form("Street_address1")
rs.Fields("Street_address2")=Request.Form("Street_address2")
rs.Fields("City")=Request.Form("City")
rs.Fields("State")=Request.Form("State")
rs.Fields("Zipcode")=Request.Form("Zipcode")
rs.Fields("Website")=Request.Form("Website")
rs.Fields("Image")=Request.Form("Image")
'Add a new record to the dataset

rs.Update
'Write the updated recordset to the database.  Problems with this line!

'Reset server objects
rs.Close
Set rs=Nothing
Set conn=Nothing

Response.Redirect "display_profile_db.asp"
'To display all the records in the database, including the new ones

%>

</body>
</html> 

form.asp:

<html>
<head>
<title>Profile Data Entry Form</title>
</head>

<Body bgcolor="#0099CC" text="white" link="#0000FF" alink="#FF0000" vlink="#663399">
<font face = "Georgia">
<H1 Align="center">Profile Data Entry Form</H1>
</font>

<form name="Form" method="post" action="add_to_db3.asp">

Facility_id
<input type = "text" name="Facility_id" size = 10>
<br>
Facility_name
<input type="text" name="Facility_name" size = 100>
<br>
Facility_description
<input type="text" name="Facility_description" size = 1000>
<br>
Street Address1
<input type="text" name="Street_address1" size = 100>
<br>
Street_Address2
<input type="text" name="Street_address2" size = 100>
City
<input type="text" name="City" size = 50>
State
<input type="text" name="State" size = 10>
<br>
Zipcode
<input type="text" name="Zipcode" size = 12>
<br>
Website
<input type="text" name="Website" size = 50>
<br>
Image
<input type="text" name="Image" size = 50>
<br>

<p><input type="Submit" name="Submit" value="SUBMIT"></p>

</form>
</body>
</html>




Replies:
Posted By: MorningZ
Date Posted: 15 April 2003 at 12:47pm
well, the files dont help much, it all has to do with giving the web server permissions to be able to edit/write files in the designated folder on the file system....

IUSER_MachineName exists in the users selection box, make no doubt about it, just give it a bit more effort and find off

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pmormr
Date Posted: 17 April 2003 at 6:44pm

your sql string needs to be "SELECT * FROM facility"



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 17 April 2003 at 6:48pm
try using the sql statement INSERT INTO instead of rs.addnew and rs.update

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: MorningZ
Date Posted: 17 April 2003 at 8:16pm
changing the method of execution is not going to affect security settings

-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net