FILE: Transactions Are Supported for ODBC Databases

ID: Q129926


The information in this article applies to:
  • Microsoft Visual Basic Standard, Professional, and Enterprise Editions, 16-bit and 32-bit, for Windows, version 4.0
  • Microsoft Visual Basic Standard and Professional Editions 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:
Q119591 How to Obtain Microsoft Support Files from Online Services

Additional query words: 2.00 3.00 4.00

Keywords : kbDatabase kbODBC kbVBp400 VB4WIN
Version : 2.00 3.00 4.00
Platform : WINDOWS
Issue type :


Last Reviewed: September 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.