opening an access db using Vc#
I downloaded teh sample code included for db example from msdn but it was out of date .Phewww
I created a dummy Access db with atable that has a few records and columns to populate my GridControl .
However for some reason (whether its a param missing or access security) am unable to connect to the database. Has anyone done anything like this that can help ? cheers
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source= D:\Mooo.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
this.Close();
}
Thanks in Advance.
Re: opening an access db using Vc#
oK GOT IT.
THE MDAC WAS OF VERSION 2.5 ..
Re: opening an access db using Vc#
moved to C# forum...
Saeed, you are "Member+". so, please double check the forum you are posting to. that's not too hard to do. posting C# post in C++.NET is not quite good...
Re: opening an access db using Vc#
that was not intentional ...
guess eyes get tired now and then
ignore this post please