Forums
This topic is locked
Password is a numeric field
Posted 06 Sep 2006 20:29:28
1
has voted
06 Sep 2006 20:29:28 David Soros posted:
I've been using the basic login.asp page along with the "Log In User" SB and never had a problem. Recently I been trying to use a numeric field in the database for the password lookup field in the SB but keep getting an error about mis-matched fields. So thinking as I do sometimes, I changed the numeric field to a text field (in the DB) and the login page works great, but then all of the other pages which rely on this numertic field don't, well not without recoding ALL of them, and I don't want to redo the entire site.
Is there anyway I can use a numeric field for the password lookup?
I'm not a programmer but I think the problem is in the SB which is placing a number of quotes (required for text fields but not numeric) but I'm not sure which one or two quotes are the problem, but below is part of the code, and I placed a couple of ## where I think the problem lies. Any help would be appreciated.
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("EmailTXT")
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="UHome.asp"
MM_redirectLoginFailed="Sorry.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_ShoeStore_STRING
MM_rsUser.Source = "SELECT Email, ControlNumb"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
## MM_rsUser.Source = MM_rsUser.Source & " FROM Orders WHERE Email='" & Replace(MM_valUsername,"'","''" &"' AND ControlNumb='" & Replace(Request.Form("ControlTXT","'","''" & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username" = MM_valUsername
If (MM_fldUserAuthorization <> "" Then
Session("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization" = ""
End If
if CStr(Request.QueryString("accessdenied") <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If<b></b><b></b><b></b>