Home All Groups Group Topic Archive Search About

Reading the application folder..

Author
6 Mar 2006 11:47 PM
Pete Smith
I have written an ASP.Net application which reads the data from MS Access
file.

Here is the connection string value.

            "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDB.mdb;User
Id=admin;Password=;"

What should be the database path name If I keep the .mdb file in the
application folder.

..Net Framework 1.1.

Thank you,

Pete

Author
7 Mar 2006 2:46 AM
vbnetdev
Try This....substitue App_Data for folder db is in.

Public Function App_Path() As String
        Return System.AppDomain.CurrentDomain.BaseDirectory()
    End Function

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App_Path() &
"\App_Data\MyDB.mdb;User
Id=admin;Password=;"


--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com



Show quoteHide quote
"Pete Smith" <PeteSmit***@hotmail.com> wrote in message
news:uI7DkgXQGHA.1556@TK2MSFTNGP09.phx.gbl...
>
>
> I have written an ASP.Net application which reads the data from MS Access
> file.
>
> Here is the connection string value.
>
>            "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDB.mdb;User
> Id=admin;Password=;"
>
> What should be the database path name If I keep the .mdb file in the
> application folder.
>
> .Net Framework 1.1.
>
> Thank you,
>
> Pete
>
>
>
>
>
>