Reading the application folder..

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
 
V

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top