Ask a Question related to ASP Database, Design and Development.
-
Looking For Help2 #1
Help with 'Object Read Only' ERROR!
Just simple new at this..
my setup is:
XP Prof, running IIS
Access 2002
I have a simple database that I'm trying to make available via web pages..
I can display teh contents of the page but when I write to the DB I get the
ERROR:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object
is read-only.
------- END of ERROR MSG -------
My ASP code looks is:
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.Form("ID_no"))
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("guestbook.mdb")
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblComments.* FROM tblComments WHERE ID_no=" & lngRecordNo
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields("Name") = Request.Form("name")
rsUpdateEntry.Fields("Comments") = Request.Form("comments")
'Write the updated recordset to the database
rsUpdateEntry.Update
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page incase another record needs deleting
Response.Redirect "update_select.asp"
%>
------- END of CODE -------
What am I missing? is it a Access setup, security issue?
Thanks
Looking For Help2 Guest
-
Strange error from: Dim myState As Object() = CType(savedState, Object())
Every book and every website I've seen that talks about how to save state for child controls in a composite webcontrol says to do something like... -
Mysterious Error: Object reference not set to an instance of an object
Hi There! I'm having a mysterious error right after I login using Forms Authentication in my ASP.NET app. Below is the error... Exception... -
How to get out of this error message "Database or object is read-only"
After I moved my ASP pages and an Access database from PWS in NT 4.0 to IIS 5.0 in XP Pro, I can't edit data in the database through the ASP web... -
Can't read Session Object
There is no great way to share session state between ASP and ASP.NET. But that doesn't mean you don't have options. Here are some common ways:... -
HELP! Error Loading ASPX : Object Reference not set to an instance object
Hello, When i run my aspx i get this weird error: System.NullReferenceException: Object reference not set to an instance of an object. at... -
Ray at #2
Re: Help with 'Object Read Only' ERROR!
"Looking For Help2" <dgpeter@mindspring.com> wrote in message
news:eA9qb.2188$gn1.133812@news1.news.adelphia.net ...
Get an OLEDB connection string from [url]www.connectionstrings.com[/url] and also read> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
the page linked below.
object> [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or[url]http://www.aspfaq.com/2009[/url]> is read-only.
Ray at work
Ray at Guest
-
cnovela3@hotmail.com #3
Re: Help with
You have a common problem. Go into IIS and change the permission of your database file the *.mdb file should be changed from read only (DEFAULT) to read/write.
This is a problem with web host.
You can read but you cant write.
After you change the file on the IIS box,
then you can write to the access database.
For example addnew will add a new record.
Remember you have to change the permissions of all your *.mdb files.
************************************************** ********************
Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
cnovela3@hotmail.com Guest
-
Ray at #4
Re: Help with
Actually, the NTFS permissions for the directory containing the .mdb file
will have to be changed, since the pages will need to create and delete .ldb
files in those directories.
Ray at work
"Carlos Novela" <cnovela3@hotmail.com> wrote in message
news:eFa28JLpDHA.2808@TK2MSFTNGP10.phx.gbl...database file the *.mdb file should be changed from read only (DEFAULT) to> You have a common problem. Go into IIS and change the permission of your
read/write.ASP.NET resources...>
> This is a problem with web host.
>
> You can read but you cant write.
>
> After you change the file on the IIS box,
> then you can write to the access database.
>
> For example addnew will add a new record.
>
> Remember you have to change the permissions of all your *.mdb files.
>
> ************************************************** ********************
> Sent via Fuzzy Software @ [url]http://www.fuzzysoftware.com/[/url]
> Comprehensive, categorised, searchable collection of links to ASP &
Ray at Guest



Reply With Quote

