none
VFPOLEDB.1 Boolean Select RRS feed

  • Question

  • Hello everybody,

    im accessing my .DBF from Visual Studio 2010.

    But now i got something i cant solve.

     

    I have a Boolean Field in my .DBF but i cant read it from Visual Studio.

    connetionString = "Provider=VFPOLEDB.1;Data Source=Z:\WW\Sichern"
     sql = "select auslauf from _artik_st where auslauf = 'False'

    Error: OleDBException

    Operator/operand type mismatch.

     

    Any ideas?

     

    Thanks a lot!

     

     

    Friday, January 28, 2011 6:39 PM

Answers

  • In that case I would just run the SELECT statement (without criteria) to see what values the Boolean variable returns for True and False, and then use those values instead. For example, if 0 is returned for False then use that value in the statement:

    select auslauf from _artik_st where auslauf = 0
    

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, February 3, 2011 1:29 PM

All replies

  • This is because 'False' is evaluated as a string and not a boolean value. Try removing the single quotes.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, January 28, 2011 6:53 PM
  • "Column 'FALSE' is not found."

     

    :/

    Thursday, February 3, 2011 12:21 PM
  • In that case I would just run the SELECT statement (without criteria) to see what values the Boolean variable returns for True and False, and then use those values instead. For example, if 0 is returned for False then use that value in the statement:

    select auslauf from _artik_st where auslauf = 0
    

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, February 3, 2011 1:29 PM