CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Posts
    72

    International Boolean

    When I make a call to a recordset with "select * FROM Table WHERE myfield = " & True I get an error from non-English computers. I then tried "select * FROM Table WHERE myfield = " & CBool(-1). I still get the error of too few parameters. These both work fine on English setting computers. What works internationally?

  2. #2
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: International Boolean

    it depends on the DBMS but mostly a value 1 and 0 represents true and false respectively. so i thought you can write the statement as..?

    "SELECT * FROM Table WHERE myfield = '1'"
    or
    "SELECT * FROM Table WHERE myfield = 1"
    or
    "SELECT * FROM Table WHERE myfield"

    "SELECT * FROM Table WHERE myfield = '0'"
    or
    "SELECT * FROM Table WHERE myfield = 0"
    or
    "SELECT * FROM Table WHERE NOT myfield"
    Busy

  3. #3
    Join Date
    Oct 2003
    Location
    The Dutch Mountains
    Posts
    125

    Re: International Boolean

    Just declare a boolean

    Dim blnVal as boolean

    blnVal = True 'or blnVal= False


    rs.Open "SELECT * FROM Table WHERE myfiled=" & blnVal, db, adOpenStatic, adLockOptimistic
    Give up your guns and face the law!!

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured