Solved

How to understand Option Compare Database statement?

Posted on 2001-06-22
2
387 Views
Last Modified: 2012-06-27
Hi! I wrote a couple of modules at Access 97. The default statement is Option Compare Database. The other options are Option Compare Binary and Option Compare Text. I understand these two. But I seem not quite clear about Option Compare Database.

On Access 97 help, it says that Option Compare Database can only be used within Microsoft Access. This results in string comparisons based on the sort order determined by the locale ID of the database where the string comparisons occur.

I could not find the locale ID of the database having my modules. How do I know that? If I obtain the locale ID, how do I know its sort order? Is it based on text or binary?

I tested on the string comparison by Option Compare Database in my database. It is based on case-insensitive text sort order. I also found CollatingOrder property of the database is 1033 which is dbLangGeneral(;LANGID=0x0409;CP=1252;COUNTRY=0).

Is that means the locale ID of the database is general English and the string comparison is based on the text sort order of English which is case-insensitive?

What is a better way of understanding this?

Jzzhang
0
Comment
Question by:jzzhang
2 Comments
 
LVL 2

Accepted Solution

by:
Bicman earned 100 total points
ID: 6220547
You looked at the Help file but you needed to read a little further.  In Help, under "Option Compare Statement", select "Specifics" up at the top.  That additional explanation will point you in the right direction.

By the way, when you get to "Tools / Options", go to the Module tab and select "Require Variable Declarations".  This will add the "Option Explicit" statement to your General Declarations section every time.  It forces you to declare everything but I hate it when I type "inttest" and all my occurrences of "intTest" are suddenly changed.

Hope this helped, Bicman
0
 
LVL 2

Author Comment

by:jzzhang
ID: 6225169
Thanks for you help.

Jzzhang
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 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