You are not logged in.
When trying to run my Unittests against a MS SQL database using trhe ODBC connection, I got an "Invalid Descritor Index" error every time the external table was created by the test.
It turns out that you have to read columns in order after running a statement!
So I made the following correction to SynDBODBC.pas:
On lines 1561 and following, I orders lines so that the the ColumnUTF(x) calls were orders according to the column they were referencing, resulting in:
while Step do begin
F.ColumnName := ColumnUTF8(3);
F.ColumnType:= ODBCColumnToFieldType(ColumnInt(4),F.ColumnPrecision,F.ColumnScale);
F.ColumnTypeNative := ColumnUTF8(5);
F.ColumnLength := ColumnInt(6);
F.ColumnScale := ColumnInt(8);
F.ColumnPrecision := ColumnInt(9);
FA.Add(F);
Offline
This is a very strange issue.
I did not have it with the ODBC driver for Oracle for instance!
User code may have problem with such expectations!
I hope this is only about "special statements" like the SQLColumn() pattern.
By the way, your above code is incorrect: you call ODBCColumnToFieldType() with F.ColumnPrecision,F.ColumnScale not already retrieved.
Correct code could be:
while Step do begin
F.ColumnName := ColumnUTF8(3);
DataType := ColumnInt(4);
F.ColumnTypeNative := ColumnUTF8(5);
F.ColumnLength := ColumnInt(6);
F.ColumnScale := ColumnInt(8);
F.ColumnPrecision := ColumnInt(9);
F.ColumnType:= ODBCColumnToFieldType(DataType,F.ColumnPrecision,F.ColumnScale);
FA.Add(F);
end;
Offline
Ha, i hadn't noticed the dependency ... your correct of course
[edit]
As stated in another thread, it now turn out I was using MS SQL 2000 with these tests, and not 2005 as I was thinking.
Last edited by Bascy (2012-09-13 15:09:23)
Offline