Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    52

    Unanswered: Boolean returns translated version of TRUE and FALSE

    I have a table with a yes/no field. When I try to insert a boolean directly in the SQL string, as in:

    dim b as boolean
    b=false
    docmd.runsql("UPDATE tblx set booleanfield=" & b)

    ,things work great in the English version of MS Access. However, in a translated version (the Dutch e.g.), I get the error: enter value for parameter 'Onwaar'. It's because my system translated FALSE to Onwaar (Dutch translation of FALSE).

    Off couse, I could use a function that examines b and returns a string "TRUE" or "FALSE". But what if I've also want this do work in the French version of AC, or the german, the Chinese... My point is, is there an automatic way of doing this, without manually having to translate all this?

    Thanks alot!

    PS AC97

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: Boolean returns translated version of TRUE and FALSE

    Originally posted by ptrapp
    I have a table with a yes/no field. When I try to insert a boolean directly in the SQL string, as in:

    dim b as boolean
    b=false
    docmd.runsql("UPDATE tblx set booleanfield=" & b)

    ,things work great in the English version of MS Access. However, in a translated version (the Dutch e.g.), I get the error: enter value for parameter 'Onwaar'. It's because my system translated FALSE to Onwaar (Dutch translation of FALSE).

    Off couse, I could use a function that examines b and returns a string "TRUE" or "FALSE". But what if I've also want this do work in the French version of AC, or the german, the Chinese... My point is, is there an automatic way of doing this, without manually having to translate all this?

    Thanks alot!
    I thing that its must be another problem because i have and spanish version of Access 97 and when i downloads or uploads data base i dont have any problem the conversion is automatic ( true = verdadero ; false = falso)....

    PS AC97
    Saludos
    Norberto

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    UPDATE tblx set booleanfield = 0

    UPDATE tblx set booleanfield = 1
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Mar 2004
    Posts
    52
    OK,

    That was an easy one. Made a fucntion called :

    return_boolean(b as boolean) as string
    if b then
    return_boolean="TRUE"
    exit function
    else
    return_boolean="FALSE"
    exit function
    endif
    end function

    That way, I can use one SQL line, which keeps my code clear and it is pretty fast adapted in the rest of my existing code.

    Docmd.RunSQL("UPDATE tblx SET f1=" & return_boolean(b)).

    Comments on how to increase performance gradly appreciated!

    Philip
    Last edited by ptrapp; 04-11-04 at 10:57.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •