Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 database searches

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-12-16 : 08:09:24
steve writes "How do I make a database search using asp case insensitive. by default it is case sensitive. here is the exact code if needed
check_user.asp:

@ LANGUAGE="VBSCRIPT"




Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsCheckUser 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strUserName 'Holds the user name

strUserName = Request.Form("txtUserName")
strSQL = "SELECT KMEA.Last_Name FROM KMEA WHERE KMEA.Member_ID ='" & strUserName & "'"


Set conn = Server.CreateObject("ADODB.Connection")
conn.open "kmea"

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

rsCheckUser.Open strSQL, conn

If NOT rsCheckUser.EOF Then


If (Request.Form("txtUserPass")) = rsCheckUser("Last_Name") Then


Session("blnIsUserGood") = True


Set conn = Nothing
Set rsCheckUser = Nothing


Response.Redirect"inyougo.asp?name=" & strUserName
End If
End If

Set conn = Nothing
Set rsCheckUser = Nothing


Session("blnIsUserGood") = False


Response.Redirect"unauthorised_user_page.htm""

MaverickUK
Yak Posting Veteran

89 Posts

Posted - 2002-12-16 : 09:00:41
I'd say change the line

strSQL = "SELECT KMEA.Last_Name FROM KMEA WHERE KMEA.Member_ID ='" & strUserName & "'"

to

strSQL = "SELECT KMEA.Last_Name FROM KMEA WHERE UPPER( KMEA.Member_ID ) ='" & UCASE( strUserName ) & "'"

should do the trick?

Go to Top of Page
   

- Advertisement -