I recently tried to connect to MySQL database (don't ask me why) with latest ODBC driver. Well... It failed badly with and "Invalid window handle" error. Quick google revealed that new MySQL driver has a "feature" where they try to prompt for missing data. Theoretically this is legal thing to do, and under windows it's almost required thing to do. Now there is a bit of a problem though: SQLDriverConnect takes a parent window handle as a parameter, to be used just for such an occasion, and under Unix you set it to NULL. This is fine, except MySQL driver has a bug, where it will check for validity of said parameter, even if all needed options are supplied, and fails. It doesn't fail if I pass _NOPROMPT instead of _COMPLETE as last argument to SQLDriverConnect function. So, I suggest that you either drop prompting functionality completely, or at least test if ParentWnd is NULL, and if it is, pass _NOCONNECT. -- Ilya A. Volynets-Evenbakh Total Knowledge. CTO http://www.total-knowledge.com
List hosted by Total Knowledge