Access and C# Connection

Access Connection with C-Sharp
We are getting used to the new file formats that come with the new Office 2007. One of these new file formats is the database files with accdb extension that come with Access 2007. Let’s connect C-Sharp with Access 2007.
If we are talking about a new database, of course we need to have a new “Connection String”for this database. If you are thinking of switching to Access 2007 databases with C-Sharp in your projects like me, you can use our new “Connection String” below.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\veritabani1.accdb;Persist Security Info=False;SQLIn addition, if you are going to use a password for your database connection, you can add the password information as follows.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\veritabani1.accdb;Jet OLEDB:Database Password=MyDbPassword;SQLHaving done all this is actually not enough. If you want to use an Access 2007 database on a computer that does not have Office 2007 installed, or if you are going to use an Access 2007 database on a website, there is something you should pay attention to.
In order to access the Access and C# database on the target computer, that is, on the server where your website will run or on the computer where your program will run with the “Connection String” we wrote above, the 2007 Office System Driver: Data Connectivity Components must be installed on the system.
It is possible that you may have problems with the hosting services you have purchased, especially for websites where you will use Access 2007 database. In this case, you need to call your “Hosting” company and inform them about the situation and have them install the necessary tools on the server. Otherwise, you will not be able to access your Access 2007 database in any way.
Good luck to all of you in the Access 2003 – 2007 upgrade process 😉




