G
Guest
Hi. I'm trying to connect to an MS Access .MDB file from ASP.NET (in C#).
I've Imported System.Data and System.Data.OleDb. My code looks like:
OleDbConnection myConnection = new OleDbConnection();
myConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\xyz.mdb";
myConnection.Open();
when I try to do the last line ("myConnection.Open()"), I get an Unspecified
Error. I have no idea how to debug this!
* Is it because it can't reach the .MDB or that there are permissions
problems on it?
* Is it because maybe I don't have that exact "Provider" installed (how do I
check that)?
One more related question: in an ASP.NET .ASPX page, when I provide the path
in the connection string, if I want it to be a relative path, how do I
determine what OleDb considers to be the current path in which it would look
for the file if I provided no path information?
Your help is much appreciated.
Alex
I've Imported System.Data and System.Data.OleDb. My code looks like:
OleDbConnection myConnection = new OleDbConnection();
myConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\xyz.mdb";
myConnection.Open();
when I try to do the last line ("myConnection.Open()"), I get an Unspecified
Error. I have no idea how to debug this!
* Is it because it can't reach the .MDB or that there are permissions
problems on it?
* Is it because maybe I don't have that exact "Provider" installed (how do I
check that)?
One more related question: in an ASP.NET .ASPX page, when I provide the path
in the connection string, if I want it to be a relative path, how do I
determine what OleDb considers to be the current path in which it would look
for the file if I provided no path information?
Your help is much appreciated.
Alex