By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,599 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,599 IT Pros & Developers. It's quick & easy.

dynamic root : will this work for the includes

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.