FILE: Transactions Are Supported for ODBC Databases

Last reviewed: February 5, 1997
Article ID: Q129926
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0
  • Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
  • Visual Basic 3.0/Microsoft Access 2.0 Compatibility Layer

SUMMARY

The BeginTrans, CommitTrans, and Rollback statements in the Data Access Object (DAO) can be sent through to an ODBC backend.

MORE INFORMATION

In Visual Basic version 3.0, the BeginTrans must occur after the CreateDynaset statement and the CommitTrans or Rollback must occur before the <dynaset>.Close.

In Visual Basic version 4.0, which uses the Microsoft Jet versions 2.5 and 3.0 database engines, this restriction has been lifted. Transactions work the same way on ODBC backends as they do on local Microsoft Access data with only one exception - you cannot nest transactions against ODBC data sources.

There is no restriction in Visual Basic against using the ODBC API to code to the Microsoft Access driver, either with or without the compatibility layer. The only restriction is that you cannot use DAO to attach tables using the Microsoft Access driver. This is because Visual Basic talks directly to the Microsoft Jet database engine, so there is no need to go through ODBC. However, if you want to use the ODBC API to take advantage of its functionality in ways not exposed in DAO, then you can certainly do so.

The RJETWPV2.DOC white paper discusses the Microsoft Jet database engine version 2.0 and how it uses Open Database Connectivity (ODBC). It explains how Jet, and therefore DAO, uses ODBC. It discusses transactions as well as connection management and other topics.

The following file is available for download from the Microsoft Software Library:

 ~ Rjwpv2.exe

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from
               Online Services


KBCategory: kbprg kbref kbfile
KBSubcategory: APrgDataODBC vb4win vb4all
Additional reference words: 2.00 3.00 4.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.