IsolateODBCTrans Property

Applies To

Workspace object.

Description

Sets or returns a value that indicates whether multiple transactions that involve the same Microsoft Jet-connected ODBC data source are isolated (Microsoft Jet workspaces only).

Settings and Return Values

The setting or return value is a Boolean data type that is True if you want to isolate transactions involving the same ODBC (Open Database Connectivity) connection. False (the default) will allow multiple transactions involving the same ODBC connection.

Remarks

In some situations, you need to have multiple simultaneous transactions pending on the same ODBC connection. To do this, you need to open a separate Workspace for each transaction. Although each Workspace can have its own ODBC connection to the database, this slows system performance. Because transaction isolation isn't usually required, ODBC connections from multiple Workspace objects opened by the same user are shared by default.

Some ODBC servers, such as Microsoft SQL Server, don't allow simultaneous transactions on a single connection. If you need to have more than one transaction at a time pending against such a database, set the IsolateODBCTrans property to True on each Workspace as soon as you open it. This forces a separate ODBC connection for each Workspace.

Example

This example opens three ODBCDirect workspaces and sets their IsolateODBCTrans properties to True so that multiple transactions to the same data source will be isolated from each other.

Sub IsolateODBCTransX()

    DBEngine.DefaultType = dbUseJet

    Dim wrkJet1 As Workspace
    Dim wrkJet2 As Workspace
    Dim wrkJet3 As Workspace

    ' Open three ODBCDirect workspaces to separate
    ' transactions involving the same ODBC data source.
    Set wrkJet1 = CreateWorkspace("", "admin", "")
    wrkJet1.IsolateODBCTrans = True

    Set wrkJet2 = CreateWorkspace("", "admin", "")
    wrkJet2.IsolateODBCTrans = True

    Set wrkJet3 = CreateWorkspace("", "admin", "")
    wrkJet3.IsolateODBCTrans = True

    wrkJet1.Close
    wrkJet2.Close
    wrkJet3.Close

End Sub