Microsoft KB Archive/816633

From BetaArchive Wiki

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 "GetXaSwitch" function in the XA resource manager DLL. The call to the "GetXaSwitch" 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.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Install Oracle 9i Application Server on a computer running the Windows Server 2003-based system.
  2. 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+

  3. Create a new ActiveX DLL project in Microsoft Visual Basic 6.0. By default, Class1 is created.
  4. On the Project menu, click Project1 Properties. Change the project name to MyOracleComponent.
  5. On the Project menu, click References. Add a reference to Microsoft ActiveX Data Object 2.0, and then to Library COM+ Services Type Library.
  6. 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 "Provider=MSDAORA;Data Source=ORCL;", "scott", "tiger"
    Set rec = cnn.Execute("select * from TableName")
    
    objContext.SetComplete
    End Sub
  7. On the File menu, click Make MyOracleComponent.dll.
  8. Click Start, point to Settings, and then click Control Panel.
  9. Double-click Administrative Tools, and then double-click Component Services.
  10. Expand Component Services until you reach COM+ Applications.
  11. Right-click COM+ Applications, and then click New Application.
  12. Create a new library application, and then install the MyOracleComponent.dll in COM+.
  13. In COM+, right-click Component, and then click Properties. Click the Transactions tab, and then click Required.
  14. Click OK to save the settings.
  15. To create a client application, create a new Standard EXE project in Visual Basic 6.0.
  16. 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("MyServerName.Class1")
       obj1.TestSub
       Set obj1 = Nothing
    End Sub
  17. Click Start. You receive the error message that is described in the "Symptoms" section.

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