T
Thomas Makro
Hi everybody.
I need to have several aspx files, each with access to the same MS
Access database.
So, I could hardcode the path to the .MDB file in every aspx file, but
this would only work on my local machine, since the production web
server has the webfiles (including the MDB file), elsewhere, ie. on
e:\web\customer123\databases, where I have the .MDB files in
C:\Inetpub\wwwroot\somefolder\db.
Therefore, I want to use relative paths using server variables, like
this:
Dim strDBpath As String = GetServerVariable("APPL_PHYSICAL_PATH") &
"db\mydb.mdb"
This I can hardcode in every aspx file, but there has to be a smarter
way, so that I only have this code in one file, where all the aspx
files can access it.
The WEBconfig seems ideal for this, but it doesn't allow code, so how
do I do this?
Regards,
Thomas
I need to have several aspx files, each with access to the same MS
Access database.
So, I could hardcode the path to the .MDB file in every aspx file, but
this would only work on my local machine, since the production web
server has the webfiles (including the MDB file), elsewhere, ie. on
e:\web\customer123\databases, where I have the .MDB files in
C:\Inetpub\wwwroot\somefolder\db.
Therefore, I want to use relative paths using server variables, like
this:
Dim strDBpath As String = GetServerVariable("APPL_PHYSICAL_PATH") &
"db\mydb.mdb"
This I can hardcode in every aspx file, but there has to be a smarter
way, so that I only have this code in one file, where all the aspx
files can access it.
The WEBconfig seems ideal for this, but it doesn't allow code, so how
do I do this?
Regards,
Thomas