Field.DataType is not TFieldType.ftAutoInc
Posted: Thu 09 Jun 2016 18:20
Hello,
migrating from ado to sdac identity columns don't seem the get the datatype ftAutoInc anymore.
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.
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)));
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.