sptk



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SPTK + MySQL != love



It shouldn't show a window.. It was designed to fail if their is not enough
parameters. Can you sow me that modification (_NOPROMPT) as a diff?

2006/11/27, Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>:

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




--
Alexey Parshin,
http://www.sptk.net

List hosted by Total Knowledge

Authoright © Total Knowledge: 2005