Thread: Chapter 15!!
View Single Post
  #14 (permalink)  
Old March 10th, 2004, 09:28 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

(Is there a bunch of you, or are you pluralis majestatis?)

Anyway, what I meant is that with a new user, the rsUsers is EOF, so this code will fail:
Code:
For each strField in rsUsers.Fields
  strName = strField.Name
  strValue = strField.value
  Session(strName) = strValue
Next
If I understand your intentions correctly, you are putting the data for the user into Session variables. This allows you to use Session("EmailAddress") in other pages to retrieve someone's e-mail address, right?

Like I said, for new users this won't work because the recordset rsUsers is EOF. Instead you could do something like this:
Code:
If rsUsers.EOF Then
' New user, get the data from the form instead
Session("EmailAddress") = Request.Form("email")
... etc etc for the other fields
Else
  ' Esisting user, should be in the recordset
  For each strField in rsUsers.Fields
    strName = strField.Name
    strValue = strField.value
    Session(strName) = strValue
  Next
End If
' Redirect to MenuForRegisteredUsers here
Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.