Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use the Connect to Database command to add a SQL Server 2005 database reference to your Visual C++ project. This command opens either the Choose Data Source dialog box or the Add Connection dialog box.
To add a database reference to your C++ project
Open your SQL Server Project.
On the Tools menu, click Connect to Database.
If this is the first connection you make, the Choose Data Source dialog box appears.
In this dialog box, under Data source, select Microsoft SQL Server.
Under Data provider, choose the provider appropriate to the application you are working with.
Click Continue.
In the Add Connection dialog box, enter the requested information.
This information is different for each provider. For more help on this dialog box, click the Help icon at the top of the dialog box or press the F1 key while the dialog box is selected.
Click Advanced to display a list of properties that enable you to change settings for the selected provider.
Click Test Connection to check the connection without closing the dialog box. This way you can make adjustments to the settings if the connection does not succeed.
Click OK.
Your connection appears in Server Explorer under the Data Connections node.
See Also
Tasks
How to: Connect to a Database from Server Explorer
Reference
Add Database Reference Dialog Box