asp_databases thread: Microsoft OLE DB Provider for ODBC Drivers error '80004005'
This is the message I get:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object
is read-only.
/internal/equipschedule/includes/Funcs.inc, line 90
This is the code:
Function DeleteReservation(lReservID,sPassword)
Dim cConn,RecsAffected,PswdOK,rsSch
'on error resume next
'Open reservation record
Set cConn=ConnectServer()
**************************************************************************
Set rsReserv = Server.CreateObject("ADODB.Recordset")
Sql="select * from Reservation Where ReservID=" & lReservID
rsReserv.open Sql,cConn,adOpenDynamic,adLockOptimistic,adCmdText
**************************************************************************
If rsReserv.EOF then
rsReserv.Close
set rsReserv=Nothing
cConn.Close
Set cConn=nothing
DeleteReservation=3
Exit Function
End If
'Check Password
PswdOK=( ucase(Trim(sPassword)) = ucase(Trim(rsReserv("Password"))) )
If Not PswdOK then
'Check against the master password
PswdOK=( ucase(trim(sPassword)) =
ucase(Trim(GetMasterPassword(rsReserv("EquipID")))) )
End If
If Not PswdOK then
rsReserv.Close
set rsReserv=Nothing
cConn.Close
Set cConn=nothing
DeleteReservation=1
Exit function
End IF
'Delete Reservation
rsReserv.Delete
If Err=0 then
DeleteReservation=0
else
DeleteReservation=2
End If
'Close database
rsReserv.Close
set rsReserv=Nothing
cConn.Close
set cConn=Nothing
End Function
I have placed astricks around the problem statement. I do not understand
why I am getting this error because it is supposed to be opening the
database in the adLockOptimistic mode. I have watched the database locking
file while I was using the web site. It seems to want to lock the database
the minute I enter the database and then it never lets you back into the
database to do anything. Nowhere in my code does it make the record set
readonly so I do not understand why it is doing this. If anybody can help
I would really appreciate some advise.
Thank you,
Julie