Browse Source

odbc: use ftBlob also for SQL_VARBINARY fields because they can have size bigger than max allowed size for ftVarBytes (High(Word))

git-svn-id: trunk@44530 -
ondrej 5 years ago
parent
commit
0c8cf3e323
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/fcl-db/src/sqldb/odbc/odbcconn.pas

+ 1 - 1
packages/fcl-db/src/sqldb/odbc/odbcconn.pas

@@ -999,7 +999,7 @@ begin
       SQL_TINYINT:       begin FieldType:=ftSmallint;   FieldSize:=0; end;
       SQL_BIGINT:        begin FieldType:=ftLargeint;   FieldSize:=0; end;
       SQL_BINARY:        begin FieldType:=ftBytes;      FieldSize:=ColumnSize; end;
-      SQL_VARBINARY:     begin FieldType:=ftVarBytes;   FieldSize:=ColumnSize; end;
+      SQL_VARBINARY:     begin FieldType:=ftBlob;       FieldSize:=BLOB_BUF_SIZE; end; // the "SQL Server Native Client 11.0" reports SQL_VARBINARY for binary fields with data size bigger than High(Word), which only ftBlob can handle and not ftVarBytes
       SQL_LONGVARBINARY: begin FieldType:=ftBlob;       FieldSize:=BLOB_BUF_SIZE; end; // is a blob
       SQL_TYPE_DATE:     begin FieldType:=ftDate;       FieldSize:=0; end;
       SQL_SS_TIME2,