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

Recommended Answers

All 10 Replies

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.

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

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 :)

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

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

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.

@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?

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

@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.

@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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.