Added: November/05/2005 at 7:15am | IP Logged
|
|
|
Hello.
I have a response page that collect the user name and the password from html forms. Then, to handle the information I use 2 variables:
Dim theUser, oldPass
theUser = LCase(Request.Form("txtUserName")) oldPass = Request.Form("txtUserPass")
I named the password as "oldPass" because I'd like to allow the user to change it, and this is the purpose of this page. Then, I named two other variables to collect the new password and to redigit it again:
Dim newPass1, newPass2
newPass1 = Request.Form("newPass1") newPass2 = Request.Form("newPass2")
After, I created the connection to my SQL DB:
sqlText = "SELECT * FROM USERS WHERE user = '" & theUser & "' " & "AND password = '" & oldPass & "';" set oConn=Server.CreateObject("ADODB.connection") oConn.open "DRIVER={SQL Server}; SERVER=msde20i.terraempresas.com; DSN=neumans; UID=neumans; PWD=q5r8f388" Set oRSdb = Server.CreateObject("ADODB.Recordset") oRSdb.Open sqlText, oConn oRSdb.MoveFirst()
Then I created another varible to hold the database user name:
Dim theUserDB theUserDB = LCase(oRSdb("user"))
Until now, everything goes fine. My problem is when I try to compare the database user name and the user name collected from the form:
If theUser = theUserDB Then Response.Write "OK." Else Response.Write "Why they're not recognized as the same???" End If
Why I can't get the "OK" result? Why the code says always that, for example, john isn't john? Can anyone help me to solve this? What's the trick? What I have missed?
Thank you very much.
__________________ Marcelo Rocha
Designer and Illustrator
|