Solved

Dealing with Case sensitivity in MS Access

Posted on 2013-01-08
4
262 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 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

810 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