Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ COM ADO
I have COM+ components in a DLL registred in Windows->components.
The DLL is developed in VB and compiled using Visual Studio 6.
I can call functions in the component passing parameters and receiving values from the functions in my C++ program without problems.
The functions connects to remote DB servers and retrieves data without problem.
There are functions that returns a recordset and this is what gives me the problem.
The wrapper function is defined thus:
Adodb_tlb::_Recordset* __fastcall CheckActiveUser(long UserID/*[in]*/);
I cannot find a way of accessing this recordset in my program.
If I try to assign a variable of type: Adodb_tlb::_Recordset* to the result of this function
I get the error:
GetDefaultInterface()->CheckActiveUser(lngC_ID, (Adodb_tlb::_Recordset**)&Param3)':
Unable to enlist in the transaction. @ CompSources\\UBCore_OCX.cpp/1075"

My development environment is: "CodeGear C++Builder® 2007"
If anyone can shine a light on this I would be eternally grateful.
Posted 2-Feb-12 5:23am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your error message says "Unable to enlist in the transaction": this is the hint. Many years ago (in NT4) what's now called COM+ was called MTS, short for Microsoft Transaction Server, and its declared purpose was to support distributed transactions among different products.
Apparently, your COM+ component is configured with "transaction context/required".
If this is true, and you have access to the VB6 source (or to the person who wrote it), see whether you can change this to "transaction context/supported"; otherwise, you should create a transaction context in your C++ code before using the com+ component.
See also:
COM+ Interfaces [^] with emphasis on ITransactionContext interface[^].
If your COM+ component is not configured with "transaction context/required", my guess is wrong.
Hope this helps,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 11 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100