Path problem to _database folder from web.config

Discussion in 'ASP.NET 2.0' started by wisemx, Oct 14, 2008.

  1. Hi,
    I'm in the group of ASP.NET developers who would recommend you use an asp:AccessDataSource for this but...
    Shown below is my working example of using an Access database in the same web.config with SQL Server connections.
    Notice the first two connections are for SQL Server, the last connection, MyAccessDB, is for the _database Access file.


     
  2. I have uploadeda MS Access database to_database folder now i want to configure in web.config the path to reach the Access database. How to do it.
    Please help me

    Thanks in advance
     
  3. Hi,
    The recommended place for an Access DB is the App_Data folder.
    When placed there you can use a connection location much easier, like this:
    http://msdn.microsoft.com/en-us/library/hktw939c(VS.80).aspx

     
  4. Im having trouble connecting to access database too when I upload the database to _database folder.


    this is what I am using at the moment:


    cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=~\_database\ihrpm.mdb;Jet OLEDB:Database;")


    I tried to use the code you provided for web.config but that just gave me an error.


    Can anyone help?
     

Share This Page