none
Execute SQL statements in a MySQL database through ADODB.Connection RRS feed

  • Question

  • Hello

    We have a VB6 program that uses an ADODB.Connection to establish a database connection and use its execute function to run SQL statements, in particular insert statements.  The connection we have established is to a SQL Server.  It has been working fine.  Currently, I am trying to change the connection to a MySQL database, whose table structures are the same as our SQL server database.  I changed the connection string and the connection is ok.

    However, when it comes to running the execute function, it returns a runtime error 3246 - connection object cannot be explicitly closed while in a transaction.

    I checked the connection.status before calling execute and found that it is open.  When I use MySQL's server connections to check the status, I found that there was a connection before and after execute was called.

    I am puzzled by it.  Any idea how to find out the reason?

    I encountered this same error whether I used MySQL ODBC 5.1 Driver or MySQL ODBC 3.51 Driver.

    Thanks,

    C
    • Moved by Martin Xie - MSFT Wednesday, September 9, 2009 7:42 AM Redirect to related VB6 forums for better responses. (From:Visual Basic General)
    Thursday, September 3, 2009 12:07 AM

All replies