Link to home
Start Free TrialLog in
Avatar of seumas
seumas

asked on

Case-sensitive SQL Queries with Access Jet Engine

How do I get the VB4 Access Jet Engine to do case-sensitive queries? Eg.

SELECT * FROM someTable WHERE someField = 'i'

Here "someField" is assumed to be a text field, and I would like only 'i' records (and not 'I' records) to be returned. The default behaviour seems to be case-insensitive.
ASKER CERTIFIED SOLUTION
Avatar of milton042297
milton042297

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of milton042297
milton042297

Sorry seumas but the table is not well, but you can get this table, on VB help.
Avatar of seumas

ASKER

Hi,

I tried out this solution and it didn't work. The "Like" operator works fine in plain VB code, but in an SQL statement it is still case-insensitive. I got a solution from the newsgroup however:

SELECT * FROM someTable
WHERE someField = 'i'
AND StrComp([someField],'i',0) = 0 ;

Seumas