Adding a Launch Condition for Microsoft Data Access Components

Any Visual Basic or Visual C# application that includes data access has a dependency on Microsoft Data Access Components (MDAC) version 2.7 or later. MDAC must be installed on a target computer prior to installing your application or the application will fail.

For any application that has a dependency on MDAC, you will need to add a launch condition to the application's deployment project that checks for the correct version of MDAC and, if not found, halts the installation and warns the user.

Note   An alternative to adding a launch condition is to include an MDAC merge module in your deployment project that will automatically install MDAC, if needed. A merge module for MDAC is not included in Visual Studio .NET; however, one may be available at a later date on the Microsoft Web site.

To add a launch condition for MDAC

  1. Select the deployment project in Solution Explorer. On the View menu, choose Editor, Launch Conditions.

  2. Select the Requirements on Target Machine node. On the Action menu, choose Add Registry Launch Condition.

  3. Select the Search for RegistryEntry1 node. In the Properties window, select the RegKey property and enter Software\Microsoft\DataAccess.

  4. Select the Root property and enter vsdrrHKLM.

  5. Select the Value property and enter FullInstallVer.

  6. Select the Property property and enter MDACSEARCH.

  7. In the Launch Conditions Editor, select the Condition1 node. In the Properties window, select the Condition property and enter MDACSEARCH>="2.7".

  8. Select the Message property and enter MDAC version 2.7 or higher must be installed prior to installing this application. You can install MDAC from the Microsoft Web site https://www.microsoft.com.

    Note   You may want to modify this text for your particular situation — for example, you could point to a network share where MDAC is located.

See Also

Deployment and Dependencies | Launch Condition Management in Deployment | Deploying Applications and Components