20061219

MFC and SQLFetch

This is probably an old bug, but nevertheless one that cost me a few hours. When using a recordset in MFC 4.2 (comes with Visual Studio 6) and an odbc driver, do not open the recordset with a sql statement. That forces the first parameter in the open to be default (or dynaset which is the same). With a dynaset, MFC decides to call SQLExtendedFetch, like here

AFX_ODBC_CALL(::SQLExtendedFetch(m_hstmt, wFetchType, nRow, pdwRowsFetched, m_rgRowStatus));

And guess what ? SQLExtendedFetch returns the number of rows fetched, which AFC_ODBC_CALL freely interprets as an error code. Sure, your saying, who's using MFC4.2 now, or why not just change the source code ? All valid points, but after all, most people use the out of the box stuff, even nowadays.

All right, nuff said

20061201

Have fun racing

A new job (Cimulus) and some more time on my hand. So I'm sitting here surfing the web, when I come across these youtube videos of BBC's topgear show. Check out their race from Guildford to Nice, or the one from Alba to London. Check it out, if you like cars you like this