Help - Search - Members - Calendar
Full Version: [VB] Making text comparison case sensitive
Pixel2Life Forum > Help Section > Desktop Programming
upstream
hey, im just wondering if you guys knows how to make a text comparison case sensitive...my code looks like this:

rec.open "SELECT * FROM userlist WHERE password='" & txtpw.text & "'"

im thinking using the byte (or something similar) function (" byte(txtpw.text) ") but i dunno if it's safe and accurate..

thanks for anyone who can help me out.
J.D.
in visual basic things are already case sensitive. So if you put
CODE
if txtpw.text = "password" then
'do whatever
else
'do what ever
end if


if you ever didn't want it to be case sensitive then make your code similar to the following.
CODE
if lcase(txtpw.text) = "password" then
'do whatever
else
'do what ever
end if


~JD~
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.