Cannot update Access Database

Results 1 to 2 of 2

Thread: Cannot update Access Database

  1. #1
    Join Date
    Dec 1969

    Default Cannot update Access Database

    I am new to ASP and I am using Front Page to edit my asp pages directly on the NT Server running IIS4.0. In trying to update data in an Access database I get this error:<BR>Microsoft JET Database Engine error &#039 80040e09&#039<BR>Cannot update. Database or object is read-only.<BR>Here is my code to open the recordset:<BR>rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable<BR>Person is a table <BR><BR>If Session("PersonID") &#060;&#062; "" Then &#039 currently logged-on user<BR> rsUsers.Filter = "PersonID = &#039" & Session("PersonID") & "&#039" <BR> Else &#039 New session<BR> rsUsers.Filter = "EMailAddress = &#039" & Request.Form("email") & "&#039" & _ <BR> "AND Password = &#039" & Request.Form("password") & "&#039"<BR> If rsUsers.EOF Then &#039 User not found<BR> rsUsers.AddNew <BR> End If<BR>End If<BR><BR> &#039 write personal details to record<BR> rsUsers("EMailAddress") = Request.Form("email")<BR> rsUsers("Password") = Request.Form("password")<BR> rsUsers("FamilyName") = Request.Form("FamilyName")<BR> rsUsers("GivenName") = Request.Form("GivenName")<BR> rsUsers("StreetAddress1") = Request.Form("Address1")<BR> rsUsers("StreetAddress2") = Request.Form("Address2")<BR> rsUsers("City") = Request.Form("City")<BR> rsUsers("State") = Request.Form("State")<BR> rsUsers("PostalCode") = Request.Form("PostalCode")<BR> rsUsers("Country") = Request.Form("Country")<BR> rsUsers("Active") = True<BR> rsUsers("LastLogin") = Now<BR> rsUsers.Update &#039 update the database<BR><BR> Dim strName, strValue &#039 create session variables<BR> For each strField in rsUsers.Fields<BR> strName = strField.Name<BR> strValue = strField.value<BR> Session(strName) = strValue<BR> Next<BR> Session("blnValidUser") = True &#039 declare that current user is validated<BR> Response.Redirect "MenuForRegisteredUsers.asp"<BR>%&#062;<BR>I have tried changing the cursor type and they all give me the same error. I have no problem connecting the database and I am able to create a recordset and write data to a page but I can not make any changes to the database. Any help would be greatly appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: Cannot update Access Database

    Try this line instead. <BR><BR>rsUsers.Open "Person", objConn, adOpenStatic, adLockOptimistic, adCmdTable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts