PDA

View Full Version : write in database case sensitivity


anhlu
10-03-2002, 10:39 AM
I have create a page that register user. When user submit, i just to write in database. but the password and user become a low case. I want to make it case sensitivity. How do I really it ask the same user have enter.

<%Dim cn, query, people, num, infor, email

people = Request("Login")
email = request("email")

// write to database

cn("FName") = Request("FName")
cn("LName") = Request("LName")
cn("userN") = Request("Login")
cn("passwd") = Request("passwd")

%>
How can i make it read in case sensitivity for user name and password. (like user name: Testing passwd:ThT12ndn)
write in database the same what it look like.

Thanks

ecnarongi
10-03-2002, 04:12 PM
good question, what DB are you using I set this up before using access I will look for my notes. get back to me and tell me what DB u r using in the mean time.

ecnarongi
10-03-2002, 04:33 PM
as a matter of fact I believe in invoke case sensitivity on and off in your DB engine. I believe they all support this. let me know

anhlu
10-04-2002, 01:30 AM
I use sql server 7.0. I did try on access but couldn't get it work. So i workon sql server 7.0

Please help

Thanks

whammy
10-04-2002, 01:43 AM
In SQL Server, it doesn't write stuff to the database lowercase - so I'm assuming there is a script somewhere that lowercases them when it enters them into the database. ?

ecnarongi
10-04-2002, 02:02 AM
well I am going to have to get back to you on this when I look in a clients DB. I had a friend tell me that access is case insensitive and there is nothing to be done about that except use something called the "case sensitivity assistant" I am not sure what that is but when I get to work in the morning I will post my findings.

ecnarongi
10-04-2002, 03:26 AM
I think what he or she wants is for the user to be able to enter upper lower case strings, ie. "PassWord" and for a DB to respect that.

Roy Sinclair
10-04-2002, 03:14 PM
SQL Server writes to the database in the exact same case as it was entered, it doesn't alter the text in any way. The problem is that comparison of text values in SQL Server is case-insensitive. One simple way of getting around that could be to cast the text values as binary before comparing them.

ecnarongi
10-04-2002, 04:54 PM
I looked in my client's DB and there were all type of mixCase entries. The DB is access 97 I don't know how to get around that, at the time being not sure if its an access 97 thing, but you might have to go with an above suggestion because I don't believe I can help you like I once thought I could. :(

anhlu
10-06-2002, 11:31 PM
thank you whammy, but that not I am looking for. the thing i looking for in in SQL, when it write to database it become lower case. I need something that write into database the same what they have type, like pAssWe. but when it write in to db it became passwe. i need it write in the same and me it case sensitivity.

thanks

whammy
10-06-2002, 11:41 PM
He's having problems because he WANTS upper and lower case text...

anhlu, if the string is being WRITTEN to the database in lower case, then the application is making it lower case before (or when) it writes the string to the database (either that, or there are some bizarre case-sensitivity settings with some databases I'm not aware of).

Have you looked at the database values to see if they are upper and lower case?

Because I use Access for all of my scripts on my website, and as you can see here (http://www.solidscripts.com/solidscripts_new/displayscript.asp?sid=4), Access does NOT lower case text.

And I use SQL Server at work, and I can guarantee you that SQL Server supports upper and lower case text, as well...

If the string isn't being LCase() 'd when it's written to the database, then your problem is what Roy Sinclair said:

string comparisons in SQL Server are case-insensitive.

So if you really want to check that each character matches, you'll need to loop through all the possible matches, and then compare them after you've retrieved the variables from the database... i.e.:

Do While NOT rs.EOF
Response.Write(password = rs("password"))
rs.MoveNext
Loop

As you can see, comparing the values once retrieved works... for example:

http://www.solidscripts.com/case.asp

just contains the following:

<% = "password" = "PaSsWoRd" %>

P.S. I have deleted some of the posts (including mine) up to this point in an attempt to make this thread less confusing... I hope nobody minds.

anhlu
10-09-2002, 11:19 PM
thanks, I got it working. one of my friend remind me that why don't I use insert into db and than use
if (password = db("password")). So i use it, it working great thank you all for helping me.


Thanks