Page 1 of 1

Field.DataType is not TFieldType.ftAutoInc

Posted: Thu 09 Jun 2016 18:20
by Deeem2031
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.

Re: Field.DataType is not TFieldType.ftAutoInc

Posted: Mon 13 Jun 2016 10:43
by ViktorV
Thank you for the information. We will fix behavior of SDAC on using the USE_FTAUTOINC compiler directive in the next build.