dbTalk Databases Forums  

Transactions and SQLSetConnectOption SQL_AUTOCOMMIT

comp.databases.btrieve comp.databases.btrieve


Discuss Transactions and SQLSetConnectOption SQL_AUTOCOMMIT in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bill
 
Posts: n/a

Default Transactions and SQLSetConnectOption SQL_AUTOCOMMIT - 02-21-2007 , 11:44 AM






In the version 9 SQL Engine Reference the description of START
TRANSACTION on page 203 states the following.

"Within the ODBC standard, SQLSetConnectOption is used to specify
whether each statement is in its own transaction or the application
groups statements within a transaction.

Each statement is in its own transaction if SQLSetConnectOption is
called specifying the option SQL_AUTOCOMMIT and the value
SQL_AUTOCOMMIT_ON (this is the default). This usage means that a
transaction is started at the beginning of executing a statement and
the transaction is either automatically committed, if no error occurs,
or roled back, if error occurred, upon completion of statement
execution.

The application can group statements in a transaction if
SQLSetConnectOption is called specifying the option SQL_AUTOCOMMIT and
the value SQL_AUTOCOMMIT_OFF value."

I cannot find any way to set the SQL_AUTOCOMMIT option using the ODBC
data manager in Windows XP.

I am connecting to Pervasive 9.5 using ADO and the Pervasive ODBC
driver. I need to be able to start, commit and rollback transactions
using the ADO connection commands. Can someone tell me how to configure
the connection to allow this? Thanks.

--
..Bill.

Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: Transactions and SQLSetConnectOption SQL_AUTOCOMMIT - 02-23-2007 , 11:01 AM






In C code, you'd just do something like this:

rcode = SQLSetConnectOption(m_hdbc, SQL_AUTOCOMMIT, 0);
CHECK_RCODE(SQL_HANDLE_DBC,m_hdbc,"SQLSetConnectio nOption
SQL_AUTOCOMMIT");

I am not sure of the exact syntax for ADO, but MIcrosoft's web site
should have something about that. The only thing I can find talks
about ADO and ODBC not supporting nested transactions, so perhaps it's
not even possible.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/2007 ***

Bill wrote:

Quote:
In the version 9 SQL Engine Reference the description of START
TRANSACTION on page 203 states the following.

"Within the ODBC standard, SQLSetConnectOption is used to specify
whether each statement is in its own transaction or the application
groups statements within a transaction.

Each statement is in its own transaction if SQLSetConnectOption is
called specifying the option SQL_AUTOCOMMIT and the value
SQL_AUTOCOMMIT_ON (this is the default). This usage means that a
transaction is started at the beginning of executing a statement and
the transaction is either automatically committed, if no error occurs,
or roled back, if error occurred, upon completion of statement
execution.

The application can group statements in a transaction if
SQLSetConnectOption is called specifying the option SQL_AUTOCOMMIT and
the value SQL_AUTOCOMMIT_OFF value."

I cannot find any way to set the SQL_AUTOCOMMIT option using the ODBC
data manager in Windows XP.

I am connecting to Pervasive 9.5 using ADO and the Pervasive ODBC
driver. I need to be able to start, commit and rollback transactions
using the ADO connection commands. Can someone tell me how to
configure the connection to allow this? Thanks.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.