ODBC 3.51 DLL crashing after errors

ODBC 3.51 DLL crashing after errors

am 27.12.2005 06:06:27 von Ken Resander

------=_NextPart_000_0010_01C60AE6.58D0E9C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Versions: ODBC 3.51, Windows XP and MySQL 5.0.16.

I have a C++ program that builds DDL statements in a loop.
A bit like this:

while ( thereismoretodo )
{
makecommandbuffer ( sqlcmdbuf ) ; // with create xxx text
sqlexecdirect ( hstmnt , sqlcmdbuf ) ;
}

The loop completes if there are no errors in the sqlcmdbufs.

If there is a syntax error in a sqlcmdbuf, ODBC reports it,
and then crashes in the ODBC DLL when doing the=20
next sqlcmdbuf, even if that is error free.=20

MYODBC3! 048f724a()
ODBC32! 1f7bf622()
Memory access violation at 0xc0000005

At this stage it would appear that ODBC does not 'clear'=20
itself properly to be ready for the next sqlexecdirect.

When eliminating the error the next sqlcmdbuf will execute
OK, so the problem is consistent and reproducable. Can't do=20
editing by hand though, since there could be hundreds of DDLs
to patch.
The loop logic above works when porting DDLs to DB2,
even if there are errors.

I have been thinking about disconnecting and reconnecting=20
in the loop, but that may be too much of a sledge hammer.

Are there other ways to help ODBC back on track after=20
errors?

Best regards
Ken Resander
..

------=_NextPart_000_0010_01C60AE6.58D0E9C0--