INSIDE VISUAL INTERDEV says this can be used from
within an ASP or HTML page. Others here have said
ASP only. But is GLOBAL.ASA considered to be ASP???
I know it doesn't work, but doesn't it seem the
following GLOBAL.ASA should work? How the heck do
you work around this limitation. GLOBAL.ASA seems
like an important place to be able to include files!
TIA - Best regards, Lee Gillie
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
' GLOBAL.ASA
<!--#INCLUDE FILE="LogonFunction.asp"-->
Sub Session_OnStart
Dim UserID, Password, Method
'==Visual InterDev Generated - DataConnection startspan==
'--Project Data Connection
Session("AmSan_ConnectionString") = "DRIVER=SQL
Server;SERVER=SQLserver;APP=Microsoft (R) Developer
Studio;WSID=wsid;DATABASE=AmSan;Address=;Trusted_Connection=Yes"
Session("AmSan_ConnectionTimeout") = 15
Session("AmSan_CommandTimeout") = 30
Session("AmSan_RuntimeUserName") = "username"
Session("AmSan_RuntimePassword") = "runtimepassword"
'==Visual InterDev Generated - DataConnection endspan==
Method = 1
Session("LoggedOn") = Logon( UserID, Password, Method )
End Sub
</SCRIPT>
Cheers,
Aaron Bertrand
Lead Integrator
w a t e r w o r k s i n t e r a c t i v e i n c .
http://www.waterworksia.com/
(reply-to altered)
Lee Gillie wrote in message ...
Aaron Bertrand wrote in message ...
>Since global.asa is only run once, then just include the code inside the
>file (instead of writing include, just put the code right there). You
can't
>include a file the way you can in an .asp file because an .asa file is
>processed differently.
>
>Cheers,
>Aaron Bertrand
>Lead Integrator
>w a t e r w o r k s i n t e r a c t i v e i n c .
>http://www.waterworksia.com/
>(reply-to altered)
Thanks for your reply, Aaron...
But then I still have a copy of this code in the include file, which
ASP pages use, and now a copy of the same code in GLOBAL.ASA (ouch!)
My understanding is that functions I define in GLOBAL.ASA are not
"available" to other ASP pages. Is this not correct??
Best regards, Lee Gillie
You can include files and/or typelibs in global.asa
and have their contents available in any ASP page :
1)
global.asa :
<!--#include file=global.inc -->
<SCRIPT language=VBScript runat=server>
Sub Application_OnStart
call subfunc ' function included in global.inc
end sub
' rest of global.asa
global.inc :
<SCRIPT language=VBScript runat=server>
function subfunc
Application.Lock()
' this could be a complex calculation :
Application("sub") = "subfunc data"
Application.UnLock()
end function
</script>
...and in any asp page :
<script language=JScript runat=server>
Application.Lock();
Response.Write(Application("sub"));
Application.UnLock();
</script>
...notice that you can even mix VBScript and JScript
when doing this, since they are just different ways
of accessing the same server-side variables.
2)
If you include :
<!--METADATA TYPE="TypeLib" UUID="00000200-0000-0010-8000-00AA006D2EA4" -->
in global.asa, you can use all the ADO
constants in ADOVBS.INC in any asp page...
Juan T. Llibre
Microsoft Internet Development MVP, ClubIE Team 3
mailto:j.ll...@codetel.net.do
http://www.activeserverpages.com/multilingual
A Demo For Multilingual HTML Content from Databases
============================================
Lee Gillie wrote in message ...
>
>Aaron Bertrand wrote in message ...
>>Since global.asa is only run once, then just include the code inside the
>>file (instead of writing include, just put the code right there). You
>can't
>>include a file the way you can in an .asp file because an .asa file is
>>processed differently.
>>Aaron Bertrand