Step 1
Create a mdb file in MS Access as follows:
Create a mdb file in MS Access as follows:
- Open MS Access
- Choose Blank Database
- Save it as Microsoft Office Access Database (2000) format
Hence your mdb file is created.
Step 2
Create a table in your database.
Create a table in your database.

Step 3
Create a Windows form with a button for connectivity.
Create a Windows form with a button for connectivity.
Step 4
Import system.Data.OleDb
Import system.Data.OleDb
- using System.Data.OleDb;
- using System.Data.OleDb;
- namespace WindowsFormsApplication3
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- OleDbConnection conn;
- private void btnConnect_Click(object sender, EventArgs e)
- {
- var DBPath = Application.StartupPath + "\\Connection.mdb";
- conn = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + DBPath);
- conn.Open();
- System.Windows.Forms.MessageBox.Show("Connected successfully");
- }
- }
- }

Xoqon2003Posted May 13, 2022, 6:51 PM
I have problem with database.Error is = provider 'Microsofft.ACE.OLEDB.12.0' is not registered on local machine.what it was please help(I'm student???????)
snehal suryavanshiPosted Jul 21, 2018, 5:06 AM
Thank you sir
Viknaraj ManogararajahPosted Jul 19, 2018, 6:42 AM
Nice Article...........