Solved

Dealing with Case sensitivity in MS Access

Posted on 2013-01-08
4
257 Views
Last Modified: 2013-01-08
Good morning,

I have a series of table which I need to incorporate into a MS Access DB.  The unique key in the source tables are from a DB structure where case is also considered so, where my source data defines 12345AB and 12345Ab as unique records, MS access states these are duplicates.

Any suggestions on how to tell MS Access that these are indeed to different records?
0
Comment
Question by:MCaliebe
4 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 75 total points
ID: 38755377
you can try using the strComp(s1,s2,vbBinarycompare)  function

?strcomp("12345AB","12345Ab",vbBinaryCompare)
-1
meaning string1 is less than string2
or

?strcomp("12345Ab","12345AB",vbBinaryCompare)
 1
meaning string1 is greater than string2
0
 
LVL 77

Accepted Solution

by:
peter57r earned 125 total points
ID: 38755443
There is no way that I know of to store case-sensitive key values- Access is intrinsically case insensitive except where coding is used to specify case-sensitive comparisons..
To store such values I think you would need to introduce a new primary key field and use the existing key values as data.
0
 

Author Closing Comment

by:MCaliebe
ID: 38755957
Points awarded to both answers as they are both correct.  A function can be used to determine differences in a field as related to CASE, however as this item is to be used as a KEY value, MS Access won't function to differentiate based on case.
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38756031
A function can be used to determine differences in a field as related to CASE, however as this item is to be used as a KEY value, MS Access won't function to differentiate based on case.

Depends on what type of key you mean.  If you mean as a primary key, the above is correct.

As a join key, it could work, as cap1 demonstrated:

SELECT *
FROM tbl1, tbl2
WHERE StrComp(tbl1.ID, tb2.ID, 0) = 0

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now