|
@@ -1135,13 +1135,13 @@ begin
|
|
FieldSize:=dsMaxStringSize-1;
|
|
FieldSize:=dsMaxStringSize-1;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- if (FieldType in [ftInteger]) and (AutoIncAttr=SQL_FALSE) then //if the column is an autoincrementing column
|
|
|
|
- //any exact numeric type with scale 0 can have identity attr.
|
|
|
|
- //only one column per table can have identity attr.
|
|
|
|
|
|
+ // any exact numeric type with scale 0 can have identity attr.
|
|
|
|
+ // only one column per table can have identity attr.
|
|
|
|
+ if (FieldType in [ftInteger,ftLargeInt]) and (AutoIncAttr=SQL_FALSE) then
|
|
begin
|
|
begin
|
|
ODBCCheckResult(
|
|
ODBCCheckResult(
|
|
- SQLColAttribute(ODBCCursor.FSTMTHandle, // statement handle
|
|
|
|
- i, // column number
|
|
|
|
|
|
+ SQLColAttribute(ODBCCursor.FSTMTHandle, // statement handle
|
|
|
|
+ i, // column number
|
|
SQL_DESC_AUTO_UNIQUE_VALUE, // FieldIdentifier
|
|
SQL_DESC_AUTO_UNIQUE_VALUE, // FieldIdentifier
|
|
nil, // buffer
|
|
nil, // buffer
|
|
0, // buffer size
|
|
0, // buffer size
|
|
@@ -1149,7 +1149,7 @@ begin
|
|
@AutoIncAttr), // NumericAttribute
|
|
@AutoIncAttr), // NumericAttribute
|
|
SQL_HANDLE_STMT, ODBCCursor.FSTMTHandle, 'Could not get autoincrement attribute for column %d.',[i]
|
|
SQL_HANDLE_STMT, ODBCCursor.FSTMTHandle, 'Could not get autoincrement attribute for column %d.',[i]
|
|
);
|
|
);
|
|
- if AutoIncAttr=SQL_TRUE then
|
|
|
|
|
|
+ if (AutoIncAttr=SQL_TRUE) and (FieldType=ftInteger) then
|
|
FieldType:=ftAutoInc;
|
|
FieldType:=ftAutoInc;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1190,7 +1190,7 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
// add FieldDef
|
|
// add FieldDef
|
|
- TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(ColName), FieldType, FieldSize, (Nullable=SQL_NO_NULLS) and (FieldType<>ftAutoInc), i);
|
|
|
|
|
|
+ TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(ColName), FieldType, FieldSize, (Nullable=SQL_NO_NULLS) and (AutoIncAttr=SQL_FALSE), i);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|