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

Re: Unspecified Error on MyConnection.Open() to MS Access File by Val

Val
Sat Nov 13 13:39:06 CST 2004

Hi,


If it is ASP.NET environment, then I think problem related to the
permissions. Check next KB about it

http://support.microsoft.com/default.aspx?scid=kb;en-us;825738

--
Val Mazur
Microsoft MVP


"Alex Maghen" <AlexMaghen@discussions.microsoft.com> wrote in message
news:4FA08A14-12FB-47E4-ABFA-539F247F76DE@microsoft.com...
> 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