Page 1 of 1

TWordField vs TByteField for TinyInt

Posted: Thu 27 Aug 2015 13:55
by GNiessen
I have several older apps that most was built with 6.1 or earlier. And I started to see issues when I upgraded to XE8 and 7.1.6. The issue was there were a lot of TWordFields defined that referenced tinyint fields from queries or stored procedures. Instead of returning a 0 or 1, I was getting something like 42685. I found that if I changed them to TByteFields I would again get 0 or 1. Do any types translate to TWordField? Or can I blanket replace all the TWordFields with TByteField? There are over 1000, so individual replacement would be problematic. And when would this have changed?

Re: TWordField vs TByteField for TinyInt

Posted: Fri 28 Aug 2015 08:04
by azyk
Thank you for the information. We have reproduced the problem and will investigate it.

As a temporary solution to this problem, you can use Data Type Mapping - map the data type TINYINT as ftWord. For example in the dataset:

Code: Select all

MSQuery.DataTypeMap.AddDBTypeRule (msTinyint, ftWord);
More detailed information about Data Type Mapping can be found in our online documentation: http://www.devart.com/sdac/docs/index.h ... apping.htm .

Note: to use the msTinyint constant, add the MSDataTypeMap unit in the uses section.
GNiessen wrote:And when would this have changed?
RAD Studio does not support the ftByte type until version 2009, and therefore SDAC also does not support this type. In SDAC 6.10, the support for this type has been implemented for RAD Studio 2009 and subsequent versions of the studio.