We have found a reproducible problem with the Postgres ODBC driver. It has to do with the parameter replacement feature in the driver. Below is a piece of test code that shows the problem. We were able to fix the problem by making a change to execute.c in the ODBC driver code (attached).
odbc driver version : Found in both 6.50 and 7.01.0004.
postgresql database version : Found with both 7.0.2 and 7.0.3 versions of Postgres.
Server Operating System: Windows2000
Client Operation System: Windows2000
Explanation of the odbc driver bug:
/*****************************************
* ERROR HAPPENS HERE:
* If we set the buffer that we binded to column "text1" now, it will FAIL.
* The SQLExecute in doQuery() will succeed (finding 0 rows), and the
* SQLFetchScroll call will return SQL_NO_DATA_FOUND.
*
* This is because of a bug in the odbc driver. The call to SQLNumResultCols
* will execute the query in the driver, but the buffer that is binded is
* empty, so no rows will be found. This of course assumes that the table
* doesn't contain any empty records for the "text1" column, which is correct
* for our test. Then when we call SQLExcute, the driver will realize it has
* already done the query work and will not do it again, even though our
* buffer for parameter substitution has changed (next line of code below
* this comment).
*****************************************/
Zip file is attached. The code is currently set up to fail, but I describe in my comments that you can uncomment the code that sets the buffer before SQLNumResultCols to make things will work.
Thanks for your attention,
Keith Millard
![Save this SwiftCard and you'll always have up-to-date contact information. Keith Millard..
Senior Software Engineer..
Pumatech, Inc...
603.888.0666 x1185..
603.888.9817..
kmillard@pumatech.com..
www.pumatech.com..](http://MY.BUSINESS.CARD.swifttouch.com/cards/users/79LS9QBNGN3DB.jpg)
![Click on my SwiftCard and never lose contact.](http://MY.BUSINESS.CARD.swifttouch.com/cards/taglines/tagline.gif)
![Save this SwiftCard and you'll always have up-to-date contact information. Alex Shore..
Senior Software Engineer..
Pumatech..
tel 603-888-0666 x1017..
..
ashore@pumatech.com..
www.pumatech.com..](http://MY.BUSINESS.CARD.swifttouch.com/cards/users/95NN9NB1Q1FWA.jpg)