Problem with Access database connectivity in C#.Net
-
I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx
Subin Verghese Software Engineer
-
I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx
Subin Verghese Software Engineer
-
I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx
Subin Verghese Software Engineer
hi verghese, Try this 1. If you are using standard security Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;User Id=admin;Password=; 2. If you are using a password for your access file Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;Jet OLEDB:Database Password=MyDbPassword; ;) regards
Sujith Blog 123
-
Verghese, Try and below:
myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=empDB.mdb");
OLE Db Exception[^] If that doesn't work, is there any text provided with the error?
Regards, Gareth. (FKA gareth111)
Gareth, thnx for the reply but it isnt working still.......i have included the main codes below, just check thru......... using System.Data.OleDb; private OleDbConnection myCon; public Form1() { myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); InitializeComponent(); } private void Form1_Load(object sender, System.EventArgs e) { myCon.Open(); MessageBox.Show("Successfully Connected"); } And this is the error message which I'm getting : "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
Thanks
-
hi verghese, Try this 1. If you are using standard security Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;User Id=admin;Password=; 2. If you are using a password for your access file Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;Jet OLEDB:Database Password=MyDbPassword; ;) regards
Sujith Blog 123
-
Verghese, Try and below:
myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=empDB.mdb");
OLE Db Exception[^] If that doesn't work, is there any text provided with the error?
Regards, Gareth. (FKA gareth111)