need help with ado error (read only)
hello
i don't know what is going on with my code
i am trying to add a new record to an access db table and i am getting this error
*****************
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
*****************
i manualy inserted two records and was able to read them back so i know the conenction is fine.
the line that gives me the error i think is the the objRS.AddNew
and i think the culprit is this line
objRS.open SQL,MyConn,adOpenDynamic,adLockOptimistic,adCmdText
this my code
Quote:
set objRS = server.createobject("ADODB.recordset")
objRS.open SQL,MyConn,adOpenDynamic,adLockOptimistic,adCmdText
'here is my output of the two records i manualy inserted in the databse
response.write objRS ("q1")
objRS .movenext
response.write objRS ("q1")
' this is the area that causes the error because when when i comment these three lines the error is gone
objRS.AddNew
objRS ("q1") = "some string"
objRS.Update
'closing down now
objRS .close
set objRS = nothing
please does anyone have any suggestions as to how i can make this work? it looks easy but i just don't get it.
in the meantime i will study the parameter settings for the
open method of a recordset object
thanks in advance :blush:
bsw