How to create an OleDb connection using ADO.net 3.5. - TechRepublic
Question
January 11, 2010 at 05:50 AM
staffan.bostrom

How to create an OleDb connection using ADO.net 3.5.

by staffan.bostrom . Updated 16 years, 6 months ago

How do I create an OleDb connection to an MS Access database that may be placed differently on different executing machines?

I create a database app on my local PC using VS 2008. The connection string contains a hardcoded absolute path to my Access database (can be picked up from web.config)and that is OK as long as I have full control of its location.
When the app is useful, I want to move it to a web hotel and my database file will be placed somewhere relative to my personal webroot on the web server. I am able to create a DSN on the web server, but OleDb does not seem to be able to use that information to connect to my database.

So, how do I create a connection string using a relative path to my database?

Staffan

This discussion is locked

All Comments