Hi all,

I've got trouble using commit with MARS connection enable.
Here is my steps :

1) Connection :
connectString = Driver={SQL Native Client};Server=BROL\SQLEXPRESS; Database=test;Trusted_Connection=Yes;MARS_Connecti on=Yes;"

SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &ODBCenv)
SQLSetEnvAttr(ODBCenv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER *)SQL_OV_ODBC3, 0);
SQLAllocHandle(SQL_HANDLE_DBC, ODBCenv, &ODBCcon)
SQLDriverConnect(ODBCcon, NULL, connectString, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT)

2) set implicit_transaction to ON :
SQLExecDirect(stmt, "SET IMPLICIT_TRANSACTIONS ON", strlen("SET IMPLICIT_TRANSACTIONS ON"))

3) Alloc, prepare and bind for an insert statement :
SQLAllocHandle(SQL_HANDLE_STMT, ODBCcon,&(curs->stmt)
SQLPrepare(curs->stmt, curs->str, strlen(curs->str)
[some bind]

4) Then execute :
SQLExecute(curs->stmt)

No problem/error until that point.

5) Want to commit :
SQLExecDirect(stmt, "COMMIT", strlen("COMMIT"))

And there I got the error :
"The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION."

But in fact, a begin transaction should not be present while IMPLICIT_TRANSACTION is set to ON. If I remove the option "Mars Connection" from the connection string ; I don't have the problem anymore but I need this option.

Someone got any idea ?

Thanks,

Yan302