PDA

View Full Version : access / read only


cabflex
06-24-2003, 11:49 AM
Hi

Im working on a site that entails site users logging in and new users signing up etc, new users' details get added to an access database...

I can view the contents of the database no problem, but when i try to add / delete or update the database, i get the following error :

-------
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
-------

As you can see i have set the connection mode to adModeReadWrite, is there something i have forgotten to set in the IIS setup maybe?

this is some of the code im using :

Thanks !

-------

Set DB = Server.CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite

DB.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("test_db.mdb")

Set RS = Server.CreateObject ("ADODB.Recordset")

strSQL = "SELECT test_table.* FROM test_table;"

RS.CursorType = 2
RS.LockType = 3
RS.Open strSQL, DB

RS.Addnew
RS.Fields("name") = Request.Form("name")
RS.Fields("email") = Request.Form("email")
RS.Update

Response.Redirect "admin_view.asp"

RS.Close
Set RS = Nothing
Set DB = Nothing

christrinder
06-24-2003, 11:59 AM
I may be wrong, but it sounds like it may be your provider. Who is hosting your site? If it is somebody like Brinkster, then the database has to be in the 'db' directory for it to work.
Chris

cabflex
06-24-2003, 12:05 PM
thanks, i should have mentioned, im still testing it locally, so that cant be the problem, i think im just gonna put it up and debug it from the server, should negate this problem, but its irritating, it really should work !
any other ideas??

cabflex
06-24-2003, 12:10 PM
oh yeh another thing - im unable to use http://localhost/... on my machine for some reason - i have to use http://(my ip address)...
i guess theres a good chance thats related to the problem, strange as im able to call the database and view it like this, but not update it...

cheers

arnyinc
06-24-2003, 04:46 PM
Make sure the web and OS permissions on the file and directory are set to allow writing to the db.