True/False become Wahr/Falsch which breaks OLEDB to Microsoft Access

This is a discussion on True/False become Wahr/Falsch which breaks OLEDB to Microsoft Access within the basic.visual forums in Programming Languages category; Hi all, I've got a Visual Basic 6.0 application which connects via OLEDB to a Microsoft Access 2002 data source. One of my customers based in Germany has complained that it's not working properly. It turns out that the query to update the database uses VB boolean variables, but instead of putting True and False it's putting Wahr and Falsch. VB seems OK with this, but Access unfortunately is not - it thinks Whar and Falsch are variables or something. To further complicate matters I can't replicate the issue on my machine - when I switch to a German language ...

Go Back   Application Development Forum > Programming Languages > basic.visual

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-29-2008, 04:12 AM
brett@brettb.com
Guest
 
Default True/False become Wahr/Falsch which breaks OLEDB to Microsoft Access

Hi all,

I've got a Visual Basic 6.0 application which connects via OLEDB to a
Microsoft Access 2002 data source.

One of my customers based in Germany has complained that it's not
working properly. It turns out that the query to update the database
uses VB boolean variables, but instead of putting True and False it's
putting Wahr and Falsch.

VB seems OK with this, but Access unfortunately is not - it thinks
Whar and Falsch are variables or something.

To further complicate matters I can't replicate the issue on my
machine - when I switch to a German language my VB is still putting in
True and False, although dates in the GUI are in German.

Has anyone encountered this before? Is there a simple solution? I
suppose I could convert True and False to 1 and 0, but it looks like a
lot of work to do that.

Thanks!
Reply With Quote
  #2  
Old 08-29-2008, 05:41 PM
Tony Proctor
Guest
 
Default Re: True/False become Wahr/Falsch which breaks OLEDB to Microsoft Access

This is a known problem.

In the VB language, boolean literals are _always_ True and False. In other
words, the language elements are never localised or else source code would
not be transportable

When a Boolean value is formatted with CStr() or Format$(), though, then the
value may be localised. By that I mean that on a German version of Windows
then I believe you'd get "Wahr" and "Falsch". However, on a US version with
German simply selected in the Regional Settings then you'd still see "True"
and "False". I'm not sure why that's so

If you want to always convert Boolean values to known strings then something
like IIf(boolean,"True","False") would be safer.

Also, there are a few named format strings you can use with Format$, e.g.

Format$(boolean,"True/False")
Format$(boolean,"Yes/No")
Format$(boolean,"On/Off")

However, despite their names, these all get localised too :-(

Tony Proctor

<brett@brettb.com> wrote in message
news:d2585948-dcbd-40a3-8fd3-4a436220828d@8g2000hse.googlegroups.com...
> Hi all,
>
> I've got a Visual Basic 6.0 application which connects via OLEDB to a
> Microsoft Access 2002 data source.
>
> One of my customers based in Germany has complained that it's not
> working properly. It turns out that the query to update the database
> uses VB boolean variables, but instead of putting True and False it's
> putting Wahr and Falsch.
>
> VB seems OK with this, but Access unfortunately is not - it thinks
> Whar and Falsch are variables or something.
>
> To further complicate matters I can't replicate the issue on my
> machine - when I switch to a German language my VB is still putting in
> True and False, although dates in the GUI are in German.
>
> Has anyone encountered this before? Is there a simple solution? I
> suppose I could convert True and False to 1 and 0, but it looks like a
> lot of work to do that.
>
> Thanks!



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:00 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.