TWordField vs TByteField for TinyInt

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 28
Joined: Wed 18 Jan 2012 20:15

TWordField vs TByteField for TinyInt

Post by GNiessen » Thu 27 Aug 2015 13:55

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?

Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: TWordField vs TByteField for TinyInt

Post by azyk » Fri 28 Aug 2015 08:04

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: ... 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.

Post Reply