473,473 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dynamic root : will this work for the includes

Will this work - dynamic determination of root (local or web host) and
consume this in include file anywhere. I am concerned about dynamic
construction
of virtual absolute include in the consuming file. Take a look and tell me
what you think:

GLOBAL.ASA

Sub application_onstart

Application("rootDir") = Server.MapPath("/")

End sub
VIRTUAL INCLUDE
/includes/dbConn.inc

Set dbConn = Server.CreateObject("ADODB.Connection")
Conn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data source =" &
Application("rootDir") & "/database/db.mdb"
CONSUMER FILE
Index.asp
-------------------
<!--# virtual include=" & Application("rootDir") & "
/includes/dbConn.inc"-->
<html>
<body>
<%
' loop database
%>
</body>



Jul 19 '05 #1
2 2234
http://www.aspfaq.com/show.asp?id=2042
"jason" <ja***@catamaranco.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
Will this work - dynamic determination of root (local or web host) and
consume this in include file anywhere. I am concerned about dynamic
construction
of virtual absolute include in the consuming file. Take a look and tell me
what you think:

GLOBAL.ASA

Sub application_onstart

Application("rootDir") = Server.MapPath("/")

End sub
VIRTUAL INCLUDE
/includes/dbConn.inc

Set dbConn = Server.CreateObject("ADODB.Connection")
Conn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data source =" &
Application("rootDir") & "/database/db.mdb"
CONSUMER FILE
Index.asp
-------------------
<!--# virtual include=" & Application("rootDir") & "
/includes/dbConn.inc"-->
<html>
<body>
<%
' loop database
%>
</body>


Jul 19 '05 #2
Sorry! Just saw linke - very useful - would you agree that the FSO
represents an alternative to simple include files which contain eg: database
scripts or a simple web form?

- Jason
"jason" <ja***@catamaranco.com> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Blank reply...Tom
"Tom B" <sh*****@hotmail.com> wrote in message
news:eA**************@TK2MSFTNGP11.phx.gbl...
http://www.aspfaq.com/show.asp?id=2042
"jason" <ja***@catamaranco.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
Will this work - dynamic determination of root (local or web host) and
consume this in include file anywhere. I am concerned about dynamic
construction
of virtual absolute include in the consuming file. Take a look and
tell
me what you think:

GLOBAL.ASA

Sub application_onstart

Application("rootDir") = Server.MapPath("/")

End sub
VIRTUAL INCLUDE
/includes/dbConn.inc

Set dbConn = Server.CreateObject("ADODB.Connection")
Conn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data source =" &
Application("rootDir") & "/database/db.mdb"
CONSUMER FILE
Index.asp
-------------------
<!--# virtual include=" & Application("rootDir") & "
/includes/dbConn.inc"-->
<html>
<body>
<%
' loop database
%>
</body>




Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: meyousikmann | last post by:
I am having a little trouble with dynamic memory allocation. I am trying to read a text file and put the contents into a dynamic array. I know I can use vectors to make this easier, but it has to...
3
by: deejayquai | last post by:
Hi I've created a crosstab query and displayed it as a sub-report in my main report. This is fine until the data changes and the column names become incorrect. I know I have to create a...
11
by: Roman Hartmann | last post by:
hello, I do have a question regarding structs. I have a struct (profil) which has a pointer to another struct (point). The struct profil stores the coordinates of points. The problem is that I...
6
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
2
by: news.sbcglobal.net | last post by:
I hope I can explain this well enough to understand. I have a master page that is used by almost all of the pages in my site. On the master page is a table. In one of the cells in this table, I...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
2
by: =?Utf-8?B?U3VzaGlTZWFu?= | last post by:
Hello. I have problem with root host name. When I create some new site (for example, testsite1) and run this I will get URL like this http://localhost:1954/testsite1/somepage.aspx How I can...
7
by: Ajinkya | last post by:
I have writen a program for a game called game.exe Now it includes a player part to which has to be a function to be writen by someone else. Now I want to provide this exe to some tester who...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.