Lazarus
Programming => Databases => Topic started by: aducom on January 22, 2016, 02:22:56 pm
-
Not sure where to post this. I have a table in MsSQL with date as datatype. This datatype is not supported and generates an error. I corrected this in the components, but actually it should be corrected in dblib too. This one works. How should I report this?
the following code corrects the issue: mssqlconn.pp
function TMSSQLConnection.TranslateFldType(SQLDataType: integer): TFieldType;
begin
case SQLDataType of
SQLCHAR: Result:=ftFixedChar;
SQLVARCHAR: Result:=ftString;
SQLINT1: Result:=ftWord;
SQLINT2: Result:=ftSmallInt;
SQLINT4, SQLINTN: Result:=ftInteger;
SYBINT8: Result:=ftLargeInt;
SQLFLT4, SQLFLT8,
SQLFLTN: Result:=ftFloat;
SQLMONEY4, SQLMONEY,
SQLMONEYN: Result:=ftCurrency;
SQLDATETIM4, SQLDATETIME,
SQLDATETIMN: Result:=ftDateTime;
SQLIMAGE: Result:=ftBlob;
SQLTEXT: Result:=ftMemo;
SQLDECIMAL, SQLNUMERIC: Result:=ftBCD;
SQLBIT: Result:=ftBoolean;
SQLBINARY: Result:=ftBytes;
SQLVARBINARY: Result:=ftVarBytes;
SYBUNIQUE: Result:=ftGuid;
SYBVARIANT: Result:=ftBlob;
40: result := ftDateTime;
41: result := ftDateTime;
else
DatabaseErrorFmt('Unsupported SQL DataType %d "%s"', [SQLDataType, dbprtype(SQLDataType)]);
Result:=ftUnknown;
end;
end;
-
Report it in bug tracker. Describe problem, add diff code and code example to test it.
-
It is already fixed in FPC 3.0
-
Not sure as 1.6 is build with FPC 3.0? The issue was in 1.6RC1, but it is solved in 1.6RC2. So issue closed.