
January 6, 2006
After having done a multirow fetch of a PostgreSQL tablewith ODBC I use the following Microsoft Foundation Classes functions of the CRecordset class:
rs.SetRowsetCursorPosition(row);
rs.GetFieldValue(col, s);
to get all the data and put it into an array. This makes an efficient and fast code, or so I thought.
This code never gave me any problems, nor did it give any problems to Manfred Donimierski. Further testing in the US and in Italy did not and do not give any problems.
Enter Holland. In two separate places the code does not work. Instead of looping through all the rows that were fetched only the first row is retrieved, as many times as there are rows. Clearly the cursor position of the rowset does not move, or something similar. We suspect that the culprit is either the ODBC driver (which does not have a good reputation) or the operating system. Or could it be because Holland is below the sea level?
One machine that gives the problem runs Windows 2000, while all the working machines run Windows XP.
To work around the problem I have implemented in build 5 an option to use the old ODBC code which seems to work even in Holland.
To use the old code you must go to the registry:
HKEY_LOCAL_MACHINE/SOFTWARE/LOGICAL/SQL and add a new DWord parameter 'SQL ODBC version' with a value greater than 0. Note that the single quotes are not part of the parameter name but were only added for your convenience in this text.
This will tell P6 to use the old ODBC code. Please note that this code has a field length limitation of 40 characters.
Please let me know what operating system you are using if you come across this problem.