How to Create an Access Connection Using Visual Basic

Opening an Access database from Visual Basic is a simple process that requires no coding. Using a .mdb (access file) as a datasource is a very common practice in Visual Basic programs.

Things You'll Need

  • Visual Basic 2008 Express Edition
  • Access database
Show More

Instructions

    • 1

      Launch Visual Basic and create a new application

    • 2

      Under "Data," pick "Add A New Datasource."

    • 3

      Select the "Database" object and click next.

    • 4

      Select the "New Connection" button then change the Data Source to "Microsoft Access Database File" and press "OK."

    • 5

      Click "Browse" and pick the database name. Click "OK" to continue.

    • 6

      Check the box for the database tables you wish to add to the application

    • 7

      Click "Finish" to complete the addition of this database to the application.

    • 8

      To verify the Access database has been added correctly, press "Shift + Alt + D" and drag a table to the form. Press "F5" to view the database table in your application.

Tips & Warnings

  • If you receive a security error, confirm whether the database requires a password and add it to your connection.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured