Click to See Complete Forum and Search --> : Cannot Update. Database or database object is read-only. Can anybody tell me why?


mpoincare
February 21st, 2003, 12:25 PM
I want to insert data from a web page into a microsoft access 2000 database using ADO. I wrote a routine that will do the job. Basically it is structured like that:
dim CONNECTIONSTRING , rs
Set Conn = CONNECTIONSTRING
rs. open conn, "tblname"
rs.addnew
...
rs.update
rs.close
The problem is any time this CODE is executed, it stops at the line: rs.addnew and the browser (IE5) displays the message: Cannot update. Database or object is read-only. I went to the folder where the microsoft access file is located and checked to see if the read only property is checked, but it isn't. Can anybody tell what could be the problem?

DLARLICK
February 21st, 2003, 01:03 PM
I believe you will need to check your lock type on the recordset object. If you do not set it, my recollection is that the default is adLockReadOnly.

Prior to the open
set the locktype to adlockpessimistic or whatever you believe is appropriate.

Give it a try....

antares686
February 24th, 2003, 05:30 AM
It is generally considered bad practice to cross post a question. See additional responses here (http://www.codeguru.com/forum/showthread.php?s=&threadid=232331).