Connecting to a Password-Protected Microsoft Access Database : Access « ADO.Net « C# / CSharp Tutorial






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

    class Program
    {
        static void Main(string[] args)
        {
            string oledbConnectString =
                "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Northwind.accdb;" +
                "Jet OLEDB:Database Password=password;";

            using (OleDbConnection connection = new OleDbConnection(oledbConnectString))
            {
                connection.Open(  );
                Console.WriteLine("Connection State: {0}", connection.State);
                Console.WriteLine("OLE DB Provider: {0}", connection.Provider);
                Console.WriteLine("Server Version: {0}", connection.ServerVersion);
            }
        }
    }








32.1.Access
32.1.1.Connecting To Access
32.1.2.Use OleDbCommand to load data from Access database mdb
32.1.3.Read data from Access database
32.1.4.use an OleDbCommand object to read data from Access database
32.1.5.Connecting to a Microsoft Access Database
32.1.6.Connecting to a Password-Protected Microsoft Access Database