0

I have a requirement for which I have to use MS Access as database(backend) and C# windows app as frontend. I need to deploy this application on multiuser connected on LAN. So the DB is on central sever and the app installed on indivdual machines. I tried using System DSN to connect the MS Access DB but could not. Please someone help with connectionstring.

Thanks, Kanaya

1

1 Answer 1

1

You don't say why you couldn't connect to the database, but the simplest way is to use the OleDb provider for Jet (assuming of course that you have Jet installed on the client machines)

using System.Data;
using System.Data.OleDb;

//
// Code ...
//

OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\MyServer\Mydb.mdb");
conn.open();

//
// Use connection ...
//
Sign up to request clarification or add additional context in comments.

7 Comments

Or ACE for 2007 and 2010 versions.
Actually I cannot connect to DB as I connot find SystemDSN on server on any workgroup machines. Also I am using ODBC for using SystemDSN
It gives me error as "[ODBC Microsoft Access Driver] general error Unable to open registry key Temporary Ace DSN for process".
@kanayabhattad - Have you tried a File DSN (rather than System DSN) on the server?
Yes, I tried using File DSN, but as multiple user will use the database I prefer System DSN.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.