Case-sensitive WHERE UPass='PassWoRD'

A

A Ratcliffe

I've run into a fairly crazy situation, and I hope someone can help. On a
web-design with an Access database behind the scenes, I have a login page,
where I accept the User name and Password, and on postback, I run a query
against the UserInfo table to validate the login.

User names and passwords are to be case-sensitive.

Table Structure:
Id Autonumber (PK)
UName Text (16) (Indexed, no duplicates, required, no zero length)
UPass Text(16) (required, No zero length)

(How do I view the CREATE SQL for a table in Access btw?)

Unfortunately, if for example I have:-
Id 1
UName ARatcliffe
UPass: PassWOrD

in the table, when I execute:-

SELECT Id, UName, UPass
FROM UserInfo
WHERE UName='aratcliffe'
AND UPass='password'

it still finds the record. Obviously, for some illogical reason it's
case-insensitive.

How can I force it to be case-sensitive ?

Yours,

Ann-Marie Ratcliffe
(e-mail address removed)

PS. I get the same result when I test it directly in Access, so its
definitely Access at fault.
 
A

A Ratcliffe

Found a workaround.

SELECT Id, UName, UPass
FROM UserInfo
WHERE StrComp(UName,'aratcliffe',0)=0
AND StrComp(UPass,'password',0)=0

will search case-sensitively, for the example below. I still think its an
idiotic situation though.

Yours,

Ann-Marie Ratcliffe
(e-mail address removed)
 
R

Rick Brandt

A Ratcliffe said:
Found a workaround.

SELECT Id, UName, UPass
FROM UserInfo
WHERE StrComp(UName,'aratcliffe',0)=0
AND StrComp(UPass,'password',0)=0

will search case-sensitively, for the example below. I still think its an
idiotic situation though.

Some database engines are case sensitive, some are not, and some let you choose. Jet
happens to not be. While you might not agree with that, I think that for the
majority of the users for which it is targeted case sensitivity would have been a big
point of confusion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top