954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Format of the connection string to access an ACCESS database in c# over network?

Format of the connection string to access an ACCESS database in c# over network?
I want to make a OleDbConnection in c# and connect it to an access database in another PC on my lan.
This is an example of a connection string to connect to a database on my local computer:
(string strconnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DOdatabase\Database.mdb"; and it works)
and this is the connection string of the Database which I want to access :
Provider=Microsoft.ACE.OLEDB.12.0;Data Source="C:\Documents and Settings\mchct\My Documents\c#.accdb"
(it`s access2007 and I got this string from the other pc itself,this computer name is HCTADMINS).
So now How can I change the above string to connect to c#.accdb on HCTADMINS from my local PC.

plz write the string for me,
tanx alot

ebiemami
Newbie Poster
11 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

First create shared folder on HCTADMINS and set read\write permission.
Let's say we called the shared folder Database Folder
So, connection string be

string strconnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\HCTADMINS\Database Folder\c#.accdb";
Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

I AM USING MS ACCESS 2007 TO CONNECT TO A C# WINDOW APPLICATION BUT I GET AN ERROR SAYING THAT
(An OLE DB Provider was not specified in the connection string. An example would be; 'Provider = SQLOLEDB;').

PLEASE ASSIST WHERE COULD I BE WRONG

REGARDS

elizabeth mwash
Light Poster
46 posts since May 2010
Reputation Points: 9
Solved Threads: 1
 

Give me your connection string

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You