[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Case-sensitive SQL Queries with Access Jet Engine

Posted on 1997-04-23
3
Medium Priority
?
199 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:seumas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
milton042297 earned 200 total points
ID: 1425662
Your problem will be solve now ...

Use the "Like" operator instead "=".
This example returns a list of employees whose names begin with the letters A through D.
 
SELECT * FROM Employees WHERE LastName Like "[A-D]*"

 
The following table shows how you can use Like to test expressions for different patterns.
 
Kind of match              Pattern       Match (returns True)      

Multiple characters      "a*a"              "aa", "aBa", "aBBBa"      
                      "*ab*"              "abc", "AABB", "Xab"      

Special character      "a[*]a"              "a*a"      
Multiple characters      "ab*"              "abcdefg", "abc"      
Single character      "a?a"              "aaa", "a3a", "aBa"      
Single digit              "a#a"              "a0a", "a1a", "a2a"      
Range of characters      "[a-z]"              "f", "p", "j"      
Outside a range              "[!a-z]"      "9", "&", "%"      
Not a digit              "[!0-9]"      "A", "a", "&", "~"      
Combined              "a[!b-m]#"      "An9", "az0", "a99"      


Good Luck...
0
 
LVL 1

Expert Comment

by:milton042297
ID: 1425663
Sorry seumas but the table is not well, but you can get this table, on VB help.
0
 

Author Comment

by:seumas
ID: 1425664
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question