Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating An access 97 record with asp

Status
Not open for further replies.

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(&quot;Password&quot;)))<> trim(lcase(Request.Form(&quot;Password&quot;))) then
Response.Redirect(&quot;DD.asp?ErrorType=Password&quot;)
ELSE
session(&quot;loggedin&quot;) = &quot;true&quot;
set rsUpdate = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsUpdate.Open &quot;Select * FROM [User] Where UserName='&quot;& Request.Form(&quot;txtUserName&quot;)&&quot;'&quot;, cnLogin,2,3
if not rsUpdate.EOF then
rsUpdate(&quot;NumberLogins&quot;) = rsLogin(&quot;NumberLogins&quot;) + 1
rsUpdate.Update '*Here is the line the error is on
end if
END IF
END IF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top