Classic ASP BasicsFor beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Can someone please help me on figuring out adding/updating new records on an ACCESS Database please? Below is my code and the error message:
Error Message
ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
Program Code
!--#include file="Connection.asp"-->
<%
Dim rsUsers
Set rsUsers = Server.CreateObject("ADODB.Recordset")
sqlString= "SELECT * FROM Member WHERE SSN =" & Request.Form("SSN") & ";"
rsUsers.Open sqlString, objConn
If rsUsers.EOF Then
rsUsers.AddNew
Else
rsUsers.Update
End If
%>
Include File Connection.asp
<%
Dim curDir
Dim objConn
curDir = Server.MapPath("db/HFPension.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
I tried this earlier and the error message I got was
Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only.
/hfrrfnew/AddUser.asp, line 28
Where line 28 in the program is rs.Users.AddNew
I don't know why it's telling me that it's read-only. I checked the ACCESS Database permission and it is not read-only.
This used to work when all the programs and the database were in my workstation and my workstation is serving as the server. Now I transferred everything to a server and this happened. I can read and retrieve data from the server using other ASP programs though. I just can't write to it. Please help me on this problem.
I had this problem once. I could not figure it out as well since it was not marked as read only. Seems like it was a permissions problem. The folder or file permissions allowed me to read, but not write/modify.
I checked all permissions earlier but missed the web anonymous users. That had read-only permission. I changed it to read/write permission and tried my program again. It worked.