Microsoft KB Archive/816633

= PRB: &quot;The Call to the 'GetXaSwitch' Function Failed&quot; Error Message with the Oracle 9.x Client Installed =

Article ID: 816633

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.7
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows XP Professional for Itanium-based systems
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional
 * Microsoft Windows Small Business Server 2003 Premium Edition
 * Microsoft Windows Small Business Server 2003 Standard Edition

-



SYMPTOMS
When you open a Microsoft OLE DB provider for Oracle from a transactional component in Microsoft COM+ that uses an ActiveX Data Objects (ADO) connection, you may receive the following error message:

Run-time error '-2147430328 (8000d048)':

Method '~' of object '~' failed

And the following error is logged into the Event log:

Source: MSDTC

Category: XATM

Type: Warning

Event_ID: 53286

The XA Transaction Manager called the &quot;GetXaSwitch&quot; function in the XA resource manager DLL. The call to the &quot;GetXaSwitch&quot; function failed: File=d:\dnsrv\com\complus\dtc\dtc\xatm\src\xarmconn.cpp Line=2462.

For more information, visit the Help and Support Center at http://support.microsoft.com.



CAUSE
By default, when you install Oracle 9.x clients, the NetworkServices account does not have access permissions to the Oracle folder. Because Microsoft Distributed Transaction Coordinator (MSDTC) runs under a NetworkServices account in both Windows Server 2003 and Windows XP, MSDTC cannot load Oracle DLLs. Because MSDTC runs as LocalSystem in Windows 2000, you do not experience this behavior on a Windows 2000-based operating system.



WORKAROUND
To work around this problem, provide the NetworkServices account with access to all Oracle folders.



STATUS
This behavior is by design.



Steps to Reproduce the Behavior
 Install Oracle 9i Application Server on a computer running the Windows Server 2003-based system. Enable Oracle XA Transaction Support for COM+.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

193893 INFO: Using Oracle with Microsoft Transaction Server and COM+

 Create a new ActiveX DLL project in Microsoft Visual Basic 6.0. By default, Class1 is created. On the Project menu, click Project1 Properties. Change the project name to MyOracleComponent . On the Project menu, click References. Add a reference to Microsoft ActiveX Data Object 2.0, and then to Library COM+ Services Type Library.  Add the following code to Class1: Option Explicit

Public Sub TestSub Dim objContext As ObjectContext Set objContext = GetObjectContext

Dim cnn As New ADODB.Connection Dim rec As New ADODB.Recordset

cnn.Open &quot;Provider=MSDAORA;Data Source=ORCL;&quot;, &quot;scott&quot;, &quot;tiger&quot; Set rec = cnn.Execute(&quot;select * from TableName&quot;)

objContext.SetComplete End Sub </li> On the File menu, click Make MyOracleComponent.dll.</li> Click Start, point to Settings, and then click Control Panel.</li> Double-click Administrative Tools, and then double-click Component Services.</li> Expand Component Services until you reach COM+ Applications.</li> Right-click COM+ Applications, and then click New Application.</li> Create a new library application, and then install the MyOracleComponent.dll in COM+.</li> In COM+, right-click Component, and then click Properties. Click the Transactions tab, and then click Required.</li> Click OK to save the settings.</li> To create a client application, create a new Standard EXE project in Visual Basic 6.0.</li>  Add the following code to the Form1_Load event: Option Explicit

Private Sub Form_Load Dim obj1 As Object ' Create the COM+ Object Set obj1 = CreateObject(&quot;MyServerName.Class1&quot;) obj1.TestSub Set obj1 = Nothing End Sub </li> Click Start. You receive the error message that is described in the &quot;Symptoms&quot; section.</li></ol>

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Keywords: kboracle kbdatabase kbprb kberrmsg KB816633

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.