954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to set Case sensitivity in access database?

How to set case sensitivity in ms access database? I need it for password column.

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

What do you mean by set case sensitivity?

If you are comparing within c# the strings that you pull from the password field of the database will be compared case sensitive by default.

MikeyIsMe
Junior Poster
142 posts since Nov 2010
Reputation Points: 32
Solved Threads: 15
 

No it is not comparing in login form if i type hello or Hello it logs in

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

It should do, i also tested this in visual studio to check if HeLlO matched Hello and it did not, you may wish to check your login validation code itself and not the mismatch of case sensitivity :)

MikeyIsMe
Junior Poster
142 posts since Nov 2010
Reputation Points: 32
Solved Threads: 15
 

I hav chckd it allows login. I thnk i hav 2 keep it as it is :-(

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

What u have typed HeLIO and Hello? Obviously it will not allow spellings are diffrent. I want case sensitivity should checking hello and Hello.

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Use the built in function StrComp, as in "SELECT StrComp('hello', 'Hello', 0)". It will return 0 if they are the same, otherwise -1 or 1.

Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
 

@Jigz: Capital L; Little l. I do know how to spell the word and am not silly :)

@Momer: whats diff between "xxx" = "xxx" and StrComp('xxx','xxx')? Apart from one would be a bool and one an int?

MikeyIsMe
Junior Poster
142 posts since Nov 2010
Reputation Points: 32
Solved Threads: 15
 

Thanx momerath. It works.
I have used
if(txtPassword.Text.CompareTo("pwd frm db")==0)
than allow login.
Thank u

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

@mikey i know u r not silly my intension was not wrong to tell u that. I thought bymstkly u wld have typd wrong spelling.
Sorry if u hurt n thnx for d help.

Jigs28
Light Poster
42 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 
@Momer: whats diff between "xxx" = "xxx" and StrComp('xxx','xxx')? Apart from one would be a bool and one an int?


You left off the third parameter to StrComp (the zero on the end). That third parameter tells it to compare bit by bit, so they have to be the exact same characters. The normal "=" does a case insensitive string compare.

Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You