Microsoft KB Archive/293805

= PRB: Connection to Jet Database Fails If You Use DCOM and Database on Network =

Article ID: 293805

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Data Access Components 2.1 Service Pack 1
 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Data Access Components 2.5
 * Microsoft Data Access Components 2.5 Service Pack 1
 * Microsoft Data Access Components 2.6

-



This article was previously published under Q293805



SYMPTOMS
When you use Distributed Component Object Model (DCOM) to connect to an ActiveX EXE file that connects to a Microsoft Jet database on a different server, you receive the following error message:

80004005 The Microsoft Jet database engine cannot open the file '|'. It is already opened exclusively by another user, or you need permission to view its data.



CAUSE
This problem occurs because you are using the &quot;Launching User&quot; identity to connect to the database. These credentials are available to the local computer only.



RESOLUTION
There are two ways to work around this problem:
 * In DCOMCNFG for the ActiveX EXE, set the identity of the launching user to either Interactive or to a specific user (domain) account that has permissions to the other computer.
 * Place the MDB file on the same computer as the ActiveX EXE. When you connect to the MDB file, be sure to use the absolute path (for example, c:\test.mdb) instead of a universal naming convention (UNC) path or mapped drive.

Note: If the MDB file is located on an NTFS drive, you must modify permissions on both the directory and MDB file.



Steps to Reproduce Behavior
  Create a new ActiveX EXE, and paste the following code: Public Function TestIt(strCnn As String) As Boolean Dim cnn As ADODB.Connection Set cnn = New ADODB.Connection cnn.CursorLocation = adUseClient cnn.Open strCnn TestIt = True End Function  Create a new Standard EXE project in Visual Basic. Form1 is created by default. Add a Textbox control and a CommandButton control to Form1.  Paste the following code: Private Sub Command1_Click MsgBox TestIt(Text1.Text) End Sub  Register the ActiveX EXE on a Microsoft Windows NT-based computer. Make sure that the ActiveX EXE and the MDB file are located on a drive that uses NTFS. On a computer that is running Microsoft Windows 95 or Microsoft Windows 98, install the Visual Basic project, and register the ActiveX EXE.</li> Run DCOMCNFG, and configure the server object to run on the Windows NT-based computer.</li> Run the Visual Basic project.</li> In the Textbox, type a connection string to a Microsoft Jet database that is located on the network (using a UNC path or drive letter, and using Jet 4.0 OLE DB Provider or ODBC)</li> Click Command1. You receive the above-mentioned error message.</li></ol>

Additional query words: 80004005

Keywords: kbnetwork kbdatabase kbdcom kbprb KB293805

-

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

© Microsoft Corporation. All rights reserved.