Microsoft KB Archive/101518: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 60: | Line 60: | ||
Set D = Opendatabase ' an ODBC data source such as Oracle | Set D = Opendatabase ' an ODBC data source such as Oracle | ||
Begintrans | Begintrans | ||
D.Executesql( | D.Executesql("delete from sometable") | ||
Rollback | Rollback | ||
</pre> | </pre> |
Latest revision as of 09:19, 20 July 2020
Article ID: 101518
Article Last Modified on 12/9/2003
APPLIES TO
- Microsoft Visual Basic 2.0 Standard Edition
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Visual Basic 2.0 Professional Edition
- Microsoft Visual Basic 3.0 Professional Edition
This article was previously published under Q101518
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 query words: 3.00
Keywords: KB101518