Field.DataType is not TFieldType.ftAutoInc

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Deeem2031
Posts: 6
Joined: Wed 08 Jun 2016 13:45

Field.DataType is not TFieldType.ftAutoInc

Post by Deeem2031 » Thu 09 Jun 2016 18:20

Hello,

migrating from ado to sdac identity columns don't seem the get the datatype ftAutoInc anymore.

Code: Select all

qu.SQL.Text := 'select identity(int) AS x INTO #temp; SELECT * FROM #temp';
qu.Open;
Writeln(System.TypInfo.GetEnumName(TypeInfo(TFieldType), Integer(qu.Fields[0].DataType)));
As at least one part of our code relies on this behavior I'm searching for a way to achieve the same with sdac. Setting the compiler conditional "USE_FTAUTOINC" seemed promising at first but resulted in "[dcc32 Error] MSAccess.pas(736): E2137 Method 'GetFieldType' not found in base class". Once i copied the content of the "USE_FTAUTOINC-GetFieldType"-function into the actual GetFieldType-function it seemed to work fine.
Now my guess is that using ftAutoInc is a bad idea to begin with or why does sdac differ from ado in this point? If so an explanation would be nice.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Field.DataType is not TFieldType.ftAutoInc

Post by ViktorV » Mon 13 Jun 2016 10:43

Thank you for the information. We will fix behavior of SDAC on using the USE_FTAUTOINC compiler directive in the next build.

Post Reply