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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a new record to access database in ASP

Status
Not open for further replies.

kaedi

Programmer
Feb 11, 2008
2
IR
Hi all
I 'm using ASP and ADO and I want add a new record to a table. I can read from table correctly, but when I try to add a record, I get this error :
"Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only."

This is my code :
<%
Dim objConn
Set objconn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString ="provider=microsoft.jet.oledb.4.0;data source=d:\db1.mdb"
objConn.Open

Dim objRst
Set objRst = Server.CreateObject("ADODB.Recordset")
objRst.Open "users",objConn,,3,adCmdTable

objRst.addnew
objRst("user_Name")=Request("name")
objRst("user_Family")=Request("LastName")
objRst("user_Age")=Request("Age")
objRst.update
%>

Is there any error in code? or there 's a problem with my .mdb file ?
 
.... as it says in the error message, the Database is read only...


check permissions on the file.....
 
No, It 's not. I checked the parent folders and they aren 't read only as well.
 
you probably need to add the Anonymouse IUSR account to the security tab on the properties on the mdb file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top