Microsoft KB Archive/235091

= XL2000: "Could Not Use , File Already in Use" Error Running Microsoft Query =

Article ID: 235091

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q235091



SYMPTOMS
When you attempt to connect to a database using Microsoft Query, you receive an error message similar to the following:

Could not use '(unknown)'; file already in use.

Driver's SQLSetConnectAttr failed



CAUSE
This error message occurs if you selected the Exclusive check box in the Select Database dialog box. Microsoft Query requires that the database be shared because it attempts to make two connections to the driver. Exclusive mode allows only one connection.



RESOLUTION
To work around this behavior, use the appropriate method for your situation.

Method 1: If You Need to Have an Exclusive Connection
Make a read-only connection and then modify the .dsn file to make the exclusive connection. To do this, follow these steps:  On the Data menu, point to Get External Data, and then click New Database Query. Click the Databases tab. Click  and then click OK. In the Create New Data Source dialog box, follow these steps:  In the What name do you want to give your data source box, type the name you want. For example, type MyQuery .</li> In the Select a driver for the type of database you want to access list, click Microsoft Access Driver (*.mdb) and then click Connect.</li></ol> </li> Click Select.</li> Select the .mdb file you want to use and click to select the Read-Only and the Exclusive check boxes. Click OK.</li> Modify the .dsn file. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> On the Start menu, point to Find and then click Files or Folders.</li> In the Find What box, type the name of the .dsn file. If you used the file name example from step 4, type MyQuery.dsn and then click Find Now.</li> When found, open this file in Microsoft Notepad and change the "ReadOnly=1" setting to "ReadOnly=0".</li> Save the file.</li></ol> </li> Click OK.</li></ol>

Method 2: If You Do Not Have to Have an Exclusive Connection
<ol> On the Data menu, point to Get External Data, and then click New Database Query.</li> Click the Databases tab.</li> Click <New Data Source> and then click OK.</li> In the Create New Data Source dialog box, follow these steps: <ol style="list-style-type: lower-alpha;"> In the What name do you want to give your data source box, type the name you want. For example, type MyQuery .</li> In the Select a driver for the type of database you want to access list, click Microsoft Access Driver (*.mdb) and then click Connect.</li></ol> </li> Click Select.</li> <li>Select the .mdb file you want to use; click to select the Read-Only check box and then click OK.</li> <li>Click OK again.</li></ol>

Additional query words: XL2000

Keywords: kbprb kbpending KB235091

-

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

© Microsoft Corporation. All rights reserved.