I am getting the following error when trying to update a table in an access db using vb script:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
The code is:
Set Connection = Server.CreateObject("ADODB.Connection")
SQLStmt = "UPDATE DISTINCTROW [tblTotalHrs] "
SQLStmt = SQLStmt & "SET emplappr='" & emplappr & "',reghrs='" & wreghrs & "',pto='" & wpto & "',std='" & wstd & "',brvhrs='" & wbrv & "',totworked='" & wtotwork & "',ovthrs='" & wovthrs & "',weekhrs1='" & wwk1 & "',weekhrs2='" & wwk2 & "',sprvappr='" & suppappr & "',brvcomm='" & brvcomm & "',borhrs='" & borhrs & "' "
SQLStmt = SQLStmt & "WHERE empid='" & empid & "' AND ppd_end=#" & ppdend & "# "
Set RS1 = Connection.Execute(SQLStmt,RowsUpdated)
The db is accessed thru an odbc connection. This was working fine until we converted the original db to Access 2007 and created a odbc connection for the new db. Is there something in that setup that could be set as Read Only?
P.S. Wasn't sure exactly which category to put this under. If it's not the right one can someone put it to the proper one? Thanks.
It's possible it's set as Read Only, that would certainly give that error. Make sure the folder the DB is in allows for updating.
Also, make sure your connection is set correctly, to allow updates (although by default it already should but this will make sure it's set to ReadWrite ):
Connection.Mode = 3
Hey.. here is the solution:
Hope this helps..!!
this is the correct link: