Result of Filling table with typed dataset is wrong. RRS feed

  • Question

  • Well, I don't know what information I should give, but here it is as simple as it could be

    I have a typed dataset for .dbf files using the VFPOLEDB driver

    I have a table "flock" which has (frm_num, frm_floor,flk_num as decimal) where in the flock.dbf the table structure is like (frm_num Numeric 4, frm_floor Numeric 1, flk_num Numeric 2)

    Numeric 4 means it accepts 4 digit

    I had Fill method FillBy_Farm_Floor where the commandText for it is :
    SELECT frm_num, frm_floor, flk_num, flk_beg, flk_count, flk_type, `timestamp` FROM flock WHERE (frm_num = ?) AND (frm_floor = ?)

    If I open the dataset and right-click on FillBy_Farm_Floor Then Preview Data, the parameter windows will showup asking me to enter 2 values, one for frm_num and the second for frm_floor.

    Farm number 14 has 6 floors (from 1 to 6).

    If I enter 14 for frm_num and 6 for frm_floor, I should get 1 row (thats ok)

    If I enter 14 for frm_num and 66 for frm_floor I also get 1 row which is not correct

    If I enter 14 for frm_num and 7 for frm_floor I get no row which is correct

    (as my doubts) it seems the parameter value for frm_floor is truncated to 1 digit in the FillBy_Farm_floor since in the original flock.dbf file the frm_floor field is Numeric 1, but I could not find where this is translated in the dataset.

    Why I am getting a row when I enter 66?

    Farm 16 and Floor number 6

    Farm 14 and floor number 66 which does not exist


    • Moved by Youen Zen Tuesday, February 5, 2013 9:20 AM
    Saturday, January 26, 2013 2:09 PM


All replies