In this tutorial, I'll show you how to Connect to a Microsoft Access Database using C#

To play demo you can create a simple console application project, then modify your code as the following

using System;
using System.Data;
using System.Data.OleDb;

public class Connect {    
 public static void Main () { 
     string connectionString = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=.\\Northwind.mdb";
     using(OleDbConnection cn = new OleDbConnection(connectionString))
     {
         if(cn.State == ConnectionState.Closed)
             cn.Open();
         Console.WriteLine("Connect to the Northwind database");
     }
  }
}

You can put the connection string in the app.config file, that's help you easily change it

You should check if your ms access database connection is open or closed, then you can open a new connection

If you've got an error "Microsoft Access Engine", you need to install the Microsoft Access Engine 2010, then change your project target to x86 or x64 based on the Microsoft Access Engine version installed