Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - DB or object is read only error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DB or object is read only error

 Post Reply Post Reply
Author
swatson View Drop Down
Newbie
Newbie


Joined: 11 April 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote swatson Quote  Post ReplyReply Direct Link To This Post Topic: DB or object is read only error
    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 ).  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>

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2003 at 6:44pm

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

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2003 at 6:48pm
try using the sql statement INSERT INTO instead of rs.addnew and rs.update
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.