Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I get an error when I try to add a new record to my Access database.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I get this error when I try to add a record to my Access database:

Microsoft OLE DB Provider for ODBC Drivers error ' 80004005'
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/a/asp/process.asp, line 32

line 32 is when I try to call the update method...
 
Make sure you have write permission in the folder where the database resides.

Choo Khor
choo.khor@intelebill.com
 
as he said make sure you have write permission in the database. then make sure the field you're editing is editable. You may be trying to edit a field that houses uneditable data type like an image type.
 
I have already done that and checked the field type...it is just the text field type...I have write permissions to the server that I am uploading it to...and all the folders under the root directory...still it doesn't work.. !!!
 
I think this is permissions issue on database_name.mdb file itself.
 
I have turned every thing I can find that says that this file is read-only off...on my comp...on my server...still I get the same error...I even tried remaking the database under a different name...and that didn't work...
 
I had the same problem and think it has something to do with the ASP engine unable to use the Access OLEDB driver appropriately. I even had and still have the same problem as well as problems while using ADODB.Record(not Recordset)object which comes with the latest ASP 3.0. I have managed to get around the Access problem by connecting to SQL Server Database but failed to understand none of these problems were encountered in VB6. If someone throws more light on this that would be helpful.

Thanks a lot
Tony.
 
Use the OLEDB Providor for Microsoft Jet (search the MS knowledgebase for connectinString examples). This will avoid threading problems that are in the ODBC driver.

If you have security defined to the databse, there is a file in System32 that holds the security info for all MDB files on that box. The user must be able to write to this file and perhaps even the directory (Yuck!). I don't recall the file's name, but change the MDB security then sort the System 32 directory listing by last modified timestamp, and look for a likely name. You could try removing the MDB security to see if access to this file is the problem.


Larry
Larryh@ecn.ab.ca

 
I think your problem roots in your file security settings.
The IUSR_servername property should be enabled to
write into the database from an other page using a client
browser by somebody from outside.

Go to Internet Information Services on your web server, and
select your database, then choose properties/File Security.
Choose Edit at "Anonymus access...", and simply enable
anonymus access
. This should help...

Ayac
 
I'm not using PWS and I can not get a reasonable answer by anyone on how to fix this problem if I am using ws_ftp to connect to a remote server...please help...thanx
 
Either the database is getting locked or the connection string that u r using is read only so you dont have rights to change the contents in the database

also since ur using ftp to view the database u can never tell if u have execute access
and there is no rule that ur root folder has execute permission

move ur database to the cgi bin that is one folder on the server that always has execute permission

then try again

please tell me if this is working on ur local machine where u created this system
regards ::) Unicorn11
abhishek@tripmedia.com

[red]Nothing is permanent in life except Change[red]
 
Everybody seems to have forgotten to ask what type of Cursor you are using on the recordset. Could you give me a full example of the code that you are using and what web-server and platform you are running on. This would help greatly and then hopefully we should be able to solve your problem.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Are you using an ODBC DSN to open the database?
Did you check to make sure it has change permissions and is not just readonly?

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Okay...it is NT running IIS 3.0
Here is my connection string...:
<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.ConnectionString=&quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=&quot; & Server.MapPath(&quot;/a/asp/users.mdb&quot;)
Conn.Open
%>
<%
Set Records = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Records.open &quot;users&quot;, Conn, adOpenKeyset, adLockPessimistic, adCmdTable
%>

then here is where I write what is currently in the database...

<% Do While Not Records.EOF %>
<TR>
<TD><%=Records(&quot;FirstName&quot;) %> <%=Records(&quot;LastName&quot;) %></TD>
<TD><%=Records(&quot;Email&quot;) %></TD>
<TD><%=Records(&quot;Username&quot;) %></TD>
</TR>
<%
Records.MoveNext
Loop
%></TABLE>


and here is the update:

<%
Records.AddNew
Records(&quot;FirstName&quot;) = Request.Form(&quot;firstname&quot;)
Records(&quot;LastName&quot;) = Request.Form(&quot;lastname&quot;)
Records(&quot;Email&quot;) = Request.Form(&quot;email&quot;)
Records(&quot;Username&quot;) = Request.Form(&quot;username&quot;)
Records(&quot;Password&quot;) = Request.Form(&quot;password&quot;)
Records.Update '<- here is when it sees the error...
%>

 
Hmm,
bit of a quandry on this one...
Firstly I would set all the properties for the recordset individually and then give that a go as i have had problems issuing them in the open statement.
Secondly, try changing to the Jet 4 OLE DB provider and give that a go.
Thirdly, after you have opened the recordset check what the actual cursortype is as it might have changed itself as the provider will do this depending on the cursor location and the provider that you are using.
Fourthly, check the file permissions on the directory and database and make sure that the user has the correct access rights. This would be the IUSR_Machine name user as default.

If you try these and you still get no further, post again with the resulst and we'll dig a bit further.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Set Records = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Records.open &quot;users&quot;, Conn, adOpenKeyset, adLockPessimistic, adCmdTable
%>

insted of the above try this
Records.open &quot;users&quot;, Conn, adOpenKeyset, adLockOptimistic

or just

Records.open &quot;users&quot;, Conn, 1, 2 (i usually use this for access)
Records.open &quot;users&quot;, Conn, 1, 3 (i usually use this for SQL Server)

i made somemodifications in the connection string Unicorn11
abhishek@tripmedia.com

[red]Nothing is permanent in life except Change[red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top