Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 18 Getting Started with ADO .NET 447



  1. Click Microsoft Access Database File, and then click Continue (or OK).


The Add Connection dialog box opens, as shown in the following screen shot:

Now you’ll specify the location and connection settings for your database, so that
Visual Studio can build a valid connection string.


  1. Click Browse.


The Select Microsoft Access Database File dialog box opens, which functions like
an Open dialog box.


  1. Browse to the C:\Vb10sbs\Chap18 folder, click the Faculty2010 .accdb database,
    and then click Open.
    You have selected the Access database in 2007 format that I built to demonstrate
    how database fields and records are displayed within a Visual Basic program. The Add
    Connection dialog box opens again with the path name recorded. I don’t restrict access
    to this file in any way, so a user name and password are not necessary with Faculty2010
    .accdb. However, if your database requires a user name, a password, or both for use,
    you can specify it now in the User Name and Password boxes. These values are then
    included in the connection string.

  2. Click the Test Connection button.


Visual Studio attempts to open the specified database file with the connection string
that the wizard has built for you. If the database is in a recognized format and the
user name and password entries (if any) are correct, you see the message shown in the
illustration on the next page.
Free download pdf