Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between Option Compare Database and Option Compare Binary

Status
Not open for further replies.

MA04

Technical User
Dec 21, 2004
162
GB
Hi all,

I have a search and append form, for one or 2 textboxes i am calling a module which puts a value entered in them, into proper case. The code in the textbox on exit calls the module but only prompts the user with message if they want there entry into proper case if or not (vbyesno), if textybox is not null and entry is not already in proper case format.

Now the problem i got was it did not seem to run the functin like this, until i added Option Compare Binary to both module and form's module, i had to also delete Option Compare Database as i was calling this function somewhere else.

I was wondering will this affect the functionality of my database in anyway, i.e. deleting option compare database from my form's module, Whats it do?

Any help appreciated, thanks in advance.
 
Option Compare Database uses a special collating sequence ignoring punctuation symbols, dealing with accented characters and case insensitive.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Option Compare Database and Option Compare Binary are different ways of comparing and sorting text data.

The default is 'Database' and this uses text comparison which is NOT case sensitive so "AbCdE" = "aBCde".

'Binary' forces a case sensitive comparison so that "a" is not equal to "A".

Obviously I don't know anything about your code, but I think that most of the time the default of 'Database' is what users want. Even with this setting, it is possible to specify a binary comparison in single commands which use functions like StrComp() where this is needed.

If you have chnaged Database to Binary you should make sure that there is no other code in the same module which relies on the 'Database' setting.

 
Thanks for that PHV, Does that mean it won't affect the functionality of my form? i get the feeling from the above answer it won't matter?

M-.
 
Thanks Lupins,

Is there a way to use the option compare binary to be restricted to only a textbox or 2, but have option compare database for the main form module?

M-.
 
The 'Option Compare xxxx' declarative only applies to modules. It has no effect on textboxes in forms or sorting in queries etc.
If you wanted a case sensitive sort in a form or a query you would need to create a new field which contained the binary/hex equivalent of the true data and sort on that.
 
Thanks for the help Lupins,

M-.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top