This topic is locked

AfterSuccessfulLogin Session variable

2/5/2009 23:03:38
ASPRunnerPro General questions
J
JimSmiley author

I'm trying to set 3 Session varibles after a user logs in. Table name is "Login" and the fields I want to access are "Email", "ContactName" and ContactPhone". I'm using this code to set the variables and it's not working so can someone please point me in the right direction?
[codebox]str = "select * from Login"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
SESSION("Email") = "Email"

SESSION("Name") = "ContactName"

SESSION("Phone") = "ContactPhone"
rstmp.close

set rstmp=nothing[/codebox]
Thanks;
JRS

J
Jane 2/6/2009

Jim,
see my changes in Bold:

str = "select * from Login where UserName='" & username & "' and PasswordField='" & password & "'"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
SESSION("Email") = rstmp("Email")

SESSION("Name") = rstmp("ContactName")

SESSION("Phone") = rstmp("ContactPhone")
rstmp.close

set rstmp=nothing

J
JimSmiley author 2/6/2009

Thanks Jane! Just what I needed.
JS