I've compiled a test program that connects to the machine (local) DSN,
executes a single SQL select, fetches the first row, grabs all the
data from all columns using SQLGetData(), then disconnects etc.
The strange thing is that every second time I execute the program,
SQLGetData returns blank data for all fields. It's irrelevant what
query string I use - whether I keep it the same for every call, or
vary it every call.
In fact, the runs where it succeeds it returns 1
(SQL_SUCCESS_WITH_INFO), but on alternate runs it returns 0
(SQL_SUCCESS). More specfically the length of the string data it
returns is 1 byte (I believe just the null C-string terminator).
The final weird thing is that it only occurs one some tables - I have
one table that was created remoted through the Client Access ODBC
driver under Windows, and that one works fine every time. Tables that
are created directly on the AS/400 all seem to have this problem
Desperate for clues!