Hello,
We are using the TClientDataSet -> Provider -> TMSSQLQuery setup in Delphi 6.
Column of type "Bit" shows True/False ok in dataset, but locate and lookup and filter methods fail (no results) when searching/filtering for "True" or "1" values, even though there are many rows with "True" in this column. Searching/filtering for "False" or "0" works ok.
Regards,
Freerk Jelsma
SchoolMaster BV
Bit field locate/filter on true/1 fails in TClientDataSet
I've found out it writes the data as -1 for true and 0 for false, so I've made a quick fix myself in OLEDBAcess.pas in the inline function PrepareConvertableFields of Fetch.
dtBoolean:
if Boolean(WordBool(Marshal.ReadInt16(pValue))) then
Marshal.WriteInt16(pValue, 1)
So now I write 1 instead of -1.
TClientDataSet works fine with this quick fix.
Any comments?
Regards,
Freerk Jelsma
SchoolMaster BV
dtBoolean:
if Boolean(WordBool(Marshal.ReadInt16(pValue))) then
Marshal.WriteInt16(pValue, 1)
So now I write 1 instead of -1.
TClientDataSet works fine with this quick fix.
Any comments?
Regards,
Freerk Jelsma
SchoolMaster BV