Click to See Complete Forum and Search --> : Red face relative addressing to an access db?


benq
06-08-2006, 11:42 AM
hi all

i,m using visual studio 2005,
i,m trying to utilise relative rather than absolute path to the DataBase.


in the global.asax file:




void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
String ConnString;
ConnString = ConfigurationManager.AppSettings["Provider"] + Server.MapPath(ConfigurationManager.AppSettings["Amier"]);
Application["ConnString"] = ConnString;
}

/CODE]


in the webconfig file:

[CODE]

<appSettings>

<add key="Provider" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="/>
<add key="Amier" value=".\\App_Data\\shop.mdb" />
</appSettings>



here is the error:
http://img154.imageshack.us/img154/2820/121212218jh.th.gif (http://img154.imageshack.us/my.php?image=121212218jh.gif)

i have also included the web.config and global files as well

any ideas on how to set this up would be great

thanks