none
oledb driver and boolean field RRS feed

  • Question

  • Hello Everybody

    I am trying to read a DBF table with OLEDBConnectionString and OLEDBDataAdapter by using DBF specific connection string and following SQL "Select column1 from table1 where column2 = True". DBF table contains few records with true values and few records with false valves. But instead of returning records with true values, I am getting all records minus false records as result. To get a correct value in column I need to convert it into tostring value. Don't know why oledb behaves this way, any help highly appreciable.

     

    Thanks

    Sunil 

    Wednesday, December 1, 2010 12:31 PM

Answers

  • Hello Sunil,

    Sorry for the late response, did Visual Studio 2010 and 2008 was setup on the same machine? The engine is shipped with Windows OS, please see this list for different os and corresponding Msjet40.dll. You can also get the latest version there.

    -Best Regards,
    Roahn Luo MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Welcome to Microsoft All-In-One Code Framework to download or request code samples from Microsoft Community Team!
    • Marked as answer by liurong luo Monday, December 20, 2010 10:49 AM
    Wednesday, December 8, 2010 5:44 AM

All replies

  • Hello Sunil,

    "DBF table contains few records with true values and few records with false valves. But instead of returning records with true values, I am getting all records minus false records as result."

    Would you please clarify what do you actually get? Do you mean you get a record that its column2 is not true?


    Best Regards,
    Roahn Luo
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Thursday, December 2, 2010 6:21 AM
  • Hi Rohan Luo,

    Let me explain in detail,

    DBF table is something like this, column1 is string and column2 is boolean type

    column1  column2

    1

    2             true

    3             false

    4

    when selected with "select column1 from table where column2 = true" it return count of 3 instead of 1, it return 0 count for "is null" query on column2. I have tried same in visual studio 2010 i got correct count of 1, but I have to use visual studio 2008 for this project. There is definately something odd about ole db driver under visual studio 2008.

    Thanks, Sunil

     

    Thursday, December 2, 2010 10:06 AM
  • Could you post your connection string so we can see which driver/provider you are using?
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, December 2, 2010 1:46 PM
  • My connection string is

    strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source={0};Extended Properties=DBASE IV";

    strConnection = String.Format(strConnectionString, "D:\\Projects");

    if it helps.

     

    Thanks,

    Sunil

     

    Thursday, December 2, 2010 4:39 PM
  • Hello Sunil,

    Sorry for the late response, did Visual Studio 2010 and 2008 was setup on the same machine? The engine is shipped with Windows OS, please see this list for different os and corresponding Msjet40.dll. You can also get the latest version there.

    -Best Regards,
    Roahn Luo MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Welcome to Microsoft All-In-One Code Framework to download or request code samples from Microsoft Community Team!
    • Marked as answer by liurong luo Monday, December 20, 2010 10:49 AM
    Wednesday, December 8, 2010 5:44 AM