dynamic root : will this work for the includes

J

jason

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>
 
J

jason

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top