I am trying to have the user log in comparing the values entered in the login page to the values in the database. If values are good, send user to the right page. This I have done successfully. The problem is that I want the user to be sent to a page if he has logged in before. This is done by checking the value of the lastname field in table2. If there is no value, then the user is sent to a page where he must fill in information. If the user has logged in before and the lastname field has a value, then the user is sent to another page. The code that is suppose to do this (hypothetically anyway) is below, though I am having problems making it work. Could someone shed some light on the subject?<BR><BR>please note that I have left off the redirect lines of codes below and in it&#039s place used a Response.Write ("") for debugging purposes.<BR><BR><BR>Thanks,<BR><BR>Ken<BR>haubner k@trac.wsmr.army.mil<BR><BR><BR><BR>&#060;%@ LANGUAGE = "VBSCRIPT"%&#062;<BR>&#060;%<BR>&#039This page is login_action.asp the values for p_username and<BR>&#039p_password are taken from the login.asp page (not included)<BR>&#039The purpose of this page is to see if a table in the db<BR>&#039has values other than the username and password.<BR>&#039If this is true, send the user to page1.asp--nothing needs to be<BR>&#039filled in.<BR>&#039If there are no values for other fields, send<BR>&#039user to page2.asp to fill in information<BR><BR><BR>&#039 Get username and password from login.asp form<BR>p_username = Request.Form("p_username")<BR>p_password = Request.Form("p_password")<BR><BR>&#039Declare Variables<BR>Dim objConn<BR><BR>&#039Open Connection to Database<BR>set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "dbname"<BR><BR>&#039Check password value from form and compare value to password in db<BR>sqlText = "SELECT * FROM table1 where password &#039"&p_password&"&#039"<BR>Set userSet = objConn.Execute(sqlText)<BR><BR>&#039Check to see if a value for field1 exists<BR>theSQL = "SELECT * FROM table2"<BR>Set lastSet = objConn.Execute(theSQL)<BR><BR>real_password = trim(userSet("password"))<BR>real_lastname = trim(lastSet("lastname"))<BR><BR>&#039Check to see if password is good and if no value exist for the lastname<BR>&#039field in table2 do stuff<BR>if p_password = real_password AND real_lastname = "" then<BR>Response.Write ("knows user, but no info - send to page2.")<BR><BR>else<BR><BR>&#039If password and lastname are associated then do this<BR>Response.Write ("knows user and has info - send to page1.")<BR><BR>end if<BR><BR><BR>&#039Close db connection<BR>objConn.Close<BR>Set objConn = nothing<BR><BR>%&#062;<BR><BR>&#060;html&#062;<BR> &#060;BODY&#062;<BR><BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;