FIX: MTS Visual Basic Bank Sample Fails When You Disable OLE DB Session Pooling (290486)



The information in this article applies to:

  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1 SP2
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.1 (GA)
  • Microsoft Data Access Components 2.1 SP1

This article was previously published under Q290486

SYMPTOMS

If you turn off OLE DB session pooling and run the Visual Basic Bank sample program three times in succession, you receive the following error message on the third iteration:
-2147217900
[Microsoft][ODBC SQL Server Driver][SQL Server]Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

CAUSE

This error occurs because the Resource Dispenser (ODBCDM) is not calling SQLSetConnectAttrW(SQL_ATTR_ENLIST_IN_DTC) on the third iteration to enlist the statement in the Microsoft Distributed Transaction Coordinator (MS DTC) transaction.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in MDAC version 2.5 or later. You can download the latest version of MDAC from the following Microsoft Web site:

MORE INFORMATION

The Visual Basic Bank sample is installed with Microsoft Transaction Server (MTS) as part of the Microsoft Windows NT 4.0 Option Pack. By default, the sample is located in the C:\Program Files\MTS\Samples\Bank.VB folder. The instructions for the sample are in the MTS Help file on the "Setting Up the MTS Sample Bank Application" page.

Steps to Reproduce Behavior

  1. Change the OLEDB_SERVICES key under the CLSID for the MSDASQL Provider to the REG_DWORD value 0xFFFFFFFE.
  2. Run the Bank sample twice. This sample uses the SQL Server ODBC Driver.
  3. Run the Bank sample a third time. In MDAC 2.0 or 2.1, you receive the above-mentioned error message.

Modification Type:MinorLast Reviewed:11/3/2003
Keywords:kbbug kbDatabase kbfix kbMDACNoSweep KB290486