Database SELECT not working

by "Tom Campbell" <tom(at)selectsignposts.com>

 Date:  Wed, 1 Jan 2003 14:48:15 -0500
 To:  <hwg-servers(at)hwg.org>
  todo: View Thread, Original
Can someone review the following script?
That portion which is NOT remarked is working.  That portion which IS
remarked returns error 500.  It's probably a simple oversight on my part,
but I believe I need a fresh set of eyes... This underlies a logon validate
page.  I'm looking up username and password, also pulling account number
from table,  --trying to use account number to search another table for some
form header info to autopopulate an order form.
TIA
Tom Campbell
Select Signposts, Inc
<%

Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Open Application("data1_ConnectionString")

Set RS = Conn.Execute ("SELECT * From Users WHERE username =
'"&Request.Form("username")&"' AND password =
'"&Request.Form("password")&"'")

Do until RS.EOF

Pass = RS("password")

Name = RS("username")

acct = RS("account")

RS.MoveNext

loop

RS.Close

Conn.Close

IF pass = "" Then

Message = "The Password you entered is either wrong or not found in our
database. Please press the BACK button and try again."

Else

Session("password") = Pass

Session("username") = Name

session("account") = acct

'Set Conn = Server.CreateObject("ADODB.Connection")

'Conn.Open Application("data1_ConnectionString")

'Set AS = Conn.Execute ("SELECT * From Short_acct WHERE agent_phone =
'"&Session("account")&"'")

'Do until AS.EOF

'session("account") = AS("agent_phone")

'Session("Brokerage") = AS("brokerage")

'Session("Broker_phone") = AS("broker_phone")

'Session("agent") = AS("agent")

'AS.MoveNext

'loop

'AS.Close

'Conn.Close

IF Session("Ori_URL") = "" Then

Else

Response.redirect(session("Ori_URL"))

End IF

End IF

%>

HWG: hwg-servers mailing list archives, maintained by Webmasters @ IWA