Transactions on ODBC Data Sources in Visual Basic Version 3.0

Last reviewed: July 20, 1995
Article ID: Q101518
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 3.0

SUMMARY

Under the ExecuteSQL method, transactions are unsupported against ODBC data sources. Even though a transaction may be started by a Visual Basic application and this transaction space is global to all database objects, the transaction space on database objects does not include actions by the ExecuteSQL method against remote ODBC data sources such as SQL Server or Oracle.

MORE INFORMATION

When you use the ExecuteSQL method or the passthrough property on dynasets, Visual Basic version 3.0 dispatches the SQL code directly to the ODBC data source through the ODBC driver. Therefore, it does not offer any transaction support in terms of CommitTrans or Rollback even though the ODBC driver for that data source might support transactions. This behavior is by design.

The following example illustrates the behavior in Visual Basic version 3.0. The code in the example uses the ExecuteSQL method to delete all rows from the table even though a rollback is issued.

Dim D as Database Set D = Opendatabase ' an ODBC data source such as Oracle Begintrans D.Executesql("delete from sometable") Rollback


Additional reference words: 3.00
KBCategory: kbinterop kbprg
KBSubcategory: APrgDataODBC


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: July 20, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.