Guest_imported
New member
- Jan 1, 1970
- 0
I am trying to update a record that will show how many times a user has logged into a page. Access is giving me the folowing error when I try to update the record.
Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only.
/DD.asp, line 27
Here is the Code:
IF Request.Form("login"
= "login" then
dim rsLogin
dim cnLogin
dim rsPassword
dim rsUpdate
set cnLogin= server.CreateObject("ADODB.Connection"
cnLogin.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\set rsLogin = Server.CreateObject("ADODB.Recordset"
set rsPassword = Server.CreateObject("ADODB.Recordset"
rsLogin.Open "Select * From [User] Where User.UserName='" & Request.Form("txtUserName"
&"'",cnLogin,2,3
IF rsLogin.EOF AND rsLogin.BOF then
Response.Redirect("DD.asp?ErrorType=User"
ELSE
rsPassword.Open "Select * From [Password] Where Password.UserRole=" & rsLogin("UserRole"
,cnLogin
IF trim(lcase(rsPassword("Password"
))<> trim(lcase(Request.Form("Password"
)) then
Response.Redirect("DD.asp?ErrorType=Password"
ELSE
session("loggedin"
= "true"
set rsUpdate = Server.CreateObject("ADODB.Recordset"
rsUpdate.Open "Select * FROM [User] Where UserName='"& Request.Form("txtUserName"
&"'", cnLogin,2,3
if not rsUpdate.EOF then
rsUpdate("NumberLogins"
= rsLogin("NumberLogins"
+ 1
rsUpdate.Update '*Here is the line the error is on
end if
END IF
END IF
Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only.
/DD.asp, line 27
Here is the Code:
IF Request.Form("login"
dim rsLogin
dim cnLogin
dim rsPassword
dim rsUpdate
set cnLogin= server.CreateObject("ADODB.Connection"
cnLogin.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\set rsLogin = Server.CreateObject("ADODB.Recordset"
set rsPassword = Server.CreateObject("ADODB.Recordset"
rsLogin.Open "Select * From [User] Where User.UserName='" & Request.Form("txtUserName"
IF rsLogin.EOF AND rsLogin.BOF then
Response.Redirect("DD.asp?ErrorType=User"
ELSE
rsPassword.Open "Select * From [Password] Where Password.UserRole=" & rsLogin("UserRole"
IF trim(lcase(rsPassword("Password"
Response.Redirect("DD.asp?ErrorType=Password"
ELSE
session("loggedin"
set rsUpdate = Server.CreateObject("ADODB.Recordset"
rsUpdate.Open "Select * FROM [User] Where UserName='"& Request.Form("txtUserName"
if not rsUpdate.EOF then
rsUpdate("NumberLogins"
rsUpdate.Update '*Here is the line the error is on
end if
END IF
END IF