Reading the application folder..

  • Thread starter Thread starter Pete Smith
  • Start date Start date
P

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
 
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=;"
 
Back
Top