Thread: Chapter 15!!
View Single Post
  #1 (permalink)  
Old March 9th, 2004, 07:31 AM
studentinpain studentinpain is offline
Authorized User
 
Join Date: Mar 2004
Location: Plymouth, , United Kingdom.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15!!

we are having great trouble in getting our database to update when we try to add another user (register). The code from the book and website doesnt seem to work at all, so we are trying the insert into method. This is from the AddUser.asp file - the code in blue is the original code, and that in red is our code:

  rsUsers.Filter = "PersonID = '" & Session("PersonID") & "'"
  Else ' New session
    rsUsers.Filter = "EMailAddress = '" & Request.Form("email") & "'" & _
                     "AND Password = '" & Request.Form("password") & "'"
   If rsUsers.EOF Then ' User not found
      'rsUsers.AddNew ' ...so add a new record
      insertSQL = "insert into Person(emailaddress, [password], familyname, givenname, StreetAddress1, StreetAddress2, City, State, PostalCode, Country) " & _ values (" & Request.Form("email") & ", " & Request.Form("password") & ", " & Request.Form("FamilyName") & ", " & Request.Form("GivenName") & ", " & Request.Form("Address1") & ", " & Request.Form("Address2") & ", " & Request.Form("City") & ", " & Request.Form("State") & ", " & Request.Form("PostalCode") & ", " & Request.Form("Country") & ",1,#" & Now & "#);"
      objConn.execute insertSQL
' Else
' Email address and password matched with DB records -
' In this case we'll allow this to update user's personal details
    End If
  End If
                                                  ' write personal details to record
  'rsUsers("EMailAddress") = Request.Form("email")
  'rsUsers("Password") = Request.Form("password")
  'rsUsers("FamilyName") = Request.Form("FamilyName")
  'rsUsers……………..

We would be incredibly grateful if anyone out-there can give us any advice AT ALL on where to go from here, as our deadline is rapidly approaching!