| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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! |
|
#2
| |||
| |||
| 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! |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.