Jump to content


Photo

[VB] Making text comparison case sensitive


  • Please log in to reply
1 reply to this topic

#1 upstream

upstream

    Young Padawan

  • Members
  • Pip
  • 8 posts
  • Location:Laguna, Philippines

Posted 06 February 2007 - 07:12 AM

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.

#2 Jdsfighter

Jdsfighter

    Young Padawan

  • Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:USA

Posted 16 April 2007 - 06:39 AM

in visual basic things are already case sensitive. So if you put
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.
if lcase(txtpw.text) = "password" then
'do whatever
else
'do what ever
end if

~JD~




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users