Sign in to follow this  
ChemicalImbalance

[web] ASP.NET - Specifying online directories

Recommended Posts

I'm trying to connect to a database on my website. It works great locally, but when I post it online, it keeps grabbing the wrong directory. The correct path is "\user\access_db\Catalog.mdb" My host does not tell me what drive letter or anything else that it's under. When I specify that path, it assumes that I must mean "c:\user\access_db\Catalog.mdb" and promptly tells me that it can't find the file. Is there a better way to specify the path? Here's the full exception that it's returning: System.Data.OleDb.OleDbException: 'c:\user\access_db\Catalog.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. And here's the line I'm using to connect to the database:
dbconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\user\access_db\Catalog.mdb");


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this