Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database manipulation prob!!

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
could someone please help me..

im tryin to allow someone to login and even if they enter the correct name and password on a previous form, they stll get direected to choose.asp in the "if".... why can anyone tell me??? its prob something simple but i ant seeing it..

<%

'Dimension variables
Dim connection 'Holds the Database Connection Object
Dim check 'Holds the recordset for the records in the database
Dim data 'Holds the SQL query for the database
Dim totalCost
Dim quantity
Dim cost
Dim arrtime
Dim destination
Dim deptime
Dim leaving
Dim flightID
Dim total



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

Call connection.Open ("log")


check = "SELECT name, password FROM log WHERE name = '"_
& Request ( "name") & "'" _

& " AND password = '"_
& Request ( "password") & "'"


Set data = Server.CreateObject("ADODB.Recordset")

Call data.Open (check , connection)


If data.EOF Then
data.Close()
connection.Close()
Response.Redirect("choose.asp")

Else
data.Close()
connection.Close()
Response.Redirect("loginWelcome.asp")
end if
%>
 
try
Code:
If data.EOF and data.BOF Then
data.Close()
connection.Close()
Response.Redirect("choose.asp")

Else        
data.Close()
connection.Close()
Response.Redirect("loginWelcome.asp")
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top