|
-
July 28th, 2005, 08:52 PM
#1
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.
-
July 28th, 2005, 09:50 PM
#2
Re: opening an access db using Vc#
oK GOT IT.
THE MDAC WAS OF VERSION 2.5 ..
-
July 29th, 2005, 01:45 AM
#3
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...
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
-
July 29th, 2005, 03:23 AM
#4
Re: opening an access db using Vc#
that was not intentional ...
guess eyes get tired now and then
ignore this post please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|