Microsoft KB Archive/823913

= PRB: &quot;Cannot Start Your Application&quot; Error When You Open a Database Project That Has an Access Data Connection =

Article ID: 823913

Article Last Modified on 5/16/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Academic Edition

-



SYMPTOMS
You connect to a password-protected Microsoft Access database by using the Microsoft Jet 4.0 OLE DB Provider from a Microsoft Visual Studio .NET Database project, and then you remove the data connection and close the Database project. When you reopen the Database project, the data connection is not opened, and you receive the following error:

Unable to connect to database.

Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

Note The Microsoft Development Environment dialog box also appears and displays the following message:

Unable to connect to a Database specified in the Solution.

Do you want to modify this Database connection properties?



CAUSE
To open a connection to a password-protected Access database by using the Microsoft Jet 4.0 OLE DB Provider, you must provide a value to the Jet OLEDB:Database Password property. However, you cannot type a database password in the Please Enter MS JET OLE DB Initialization Information dialog box. Therefore, you receive an error when you try to open the connection to the password-protected Access database from the Database project.



WORKAROUND
To work around the problem that is described in the &quot;More Information&quot; section of this article, provide the database password in the Data Link Properties dialog box. To do this, follow these steps:
 * 1) In the Solution Explorer, expand Database References.
 * 2) Double-click the reference to the Access database. In the Please Enter MS JET OLE DB Initialization Information dialog box, click Cancel.
 * 3) In the Server Explorer message box, click OK.
 * 4) In the Microsoft Development Environment dialog box, click Yes.
 * 5) In the Data Link Properties dialog box, click the All tab.
 * 6) Click Jet OLEDB:Database Password in the properties list, and then click Edit Value.
 * 7) In the Edit Property Value dialog box, type testpwd in the Property Value box, and then click OK.
 * 8) In the Data Link Properties dialog box, click OK.

-or-

To work around the problem, provide user level security for the Access database. When you provide user level security to the database, the data connection is opened.



STATUS
This behavior is by design.



Set the Access Database Password

 * 1) Start Microsoft Access.
 * 2) On the File menu, click Open.
 * 3) In the Open dialog box, locate the Northwind.mdb file by using the following path: %Program Files%\Microsoft Office\Office10\Samples
 * 4) Select the Northwind.mdb file, and then click Open Exclusive in the Open list.

Note You must open the Northwind.mdb file in the Open Exclusive mode to set the password to the Access database.
 * 1) On the Tools menu, point to Security, and then click Set Database Password.
 * 2) In the Set Database Password dialog box, type testpwd in the Password and the Verify boxes, and then click OK.
 * 3) Close the Northwind database file.
 * 4) Quit Access.

Create a Database Project in Microsoft Visual Studio .NET


 * 1) Start Visual Studio .NET.
 * 2) On the File menu, point to New, and then click Project.
 * 3) Under Project Types, expand Other Projects, select Database Projects, and then click OK.
 * 4) In the Data Link Properties dialog box, click the Provider tab.
 * 5) In the OLE DB Provider(s) list, select Microsoft Jet 4.0 OLE DB Provider, and then click Next.
 * 6) On the Connection tab, click the ellipses (...) button.
 * 7) In the Select Access Database dialog box, locate the Northwind.mdb file by using the following path: %Program Files%\Microsoft Office\Office10\Samples
 * 8) Select the Northwind.mdb file, and then click Open.
 * 9) In the Data Link Properties dialog box, click the All tab.
 * 10) Select the Jet OLEDB:Database Password property in the properties list, and then click Edit Value.
 * 11) In the Edit Property Value dialog box, type testpwd in the Property Value box, and then click OK.
 * 12) In the Data Link Properties dialog box, click OK.
 * 13) On the File menu, click Save All.
 * 14) In the Server Explorer, right-click your Access data connection, and then click Delete.
 * 15) In the Server Explorer dialog box, click Yes.
 * 16) Quit Visual Studio .NET.
 * 17) Start Visual Studio .NET.
 * 18) On the File menu, point to Recent Projects, and then click your project.
 * 19) In the Please Enter MS JET OLE DB Initialization Information dialog box, type testpwd in the Password box, and then click OK.
 * 20) You notice the error that is mentioned in the &quot;Symptoms&quot; section of this article.

