Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: global.asa, Constants, ADODB, oh my!


Message #1 by "Charles Feduke" <webmaster@r...> on Tue, 17 Apr 2001 18:14:30 -0400

    I've made a few ADODB/ASP systems lately, and every single one of 

them has a *.asa file that includes all the global constants for ADODB.  

Every page that requires these variables, and some other global 

constants, must do a #include that particular *.asa file.



    I've seen in a couple places that you can tie a library (DLL, TLB, 

whatever) into the global.asa file.  To the best of my knowledge, the 

global.asa file is also only reloaded when it has been updated and a new 

request has been made.  My question is is there any way to bind the 

ADODB library to the global.asa file so the constants will be at hand at 

all times in all pages?  And if I do this, will there be any increase in 

page speed (even compile time/first request)?



    If so, then is it possible for me to make my own library of 

constants and tie them in in the same manner?



    Thanks.



- Chuck

Message #2 by "Ken Schaefer" <ken@a...> on Wed, 18 Apr 2001 13:41:22 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:

:     I've made a few ADODB/ASP systems lately, and every single one of 

: them has a *.asa file that includes all the global constants for ADODB.  

: Every page that requires these variables, and some other global 

: constants, must do a #include that particular *.asa file.

:

:     I've seen in a couple places that you can tie a library (DLL, TLB, 

: whatever) into the global.asa file.  To the best of my knowledge, the 

: global.asa file is also only reloaded when it has been updated and a new 

: request has been made.  My question is is there any way to bind the 

: ADODB library to the global.asa file so the constants will be at hand at 

: all times in all pages?  And if I do this, will there be any increase in 

: page speed (even compile time/first request)?

:

:     If so, then is it possible for me to make my own library of 

: constants and tie them in in the same manner?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Put something like this:



<!-- METADATA TYPE="TypeLib" FILE="c:\Program Files\Common

Files\system\ado\msado15.dll" -->



in your global.asa in the Application_OnStart sub

All your ADO constants will be available to all pages in that application.

Just unload the app in the IIS MMC Snapin to force the global.asa file to be

reloaded.



Cheers

Ken



Message #3 by "Daniel O'Dorisio" <dodorisio@h...> on Tue, 17 Apr 2001 19:14:11 -0400
check out Ken's site



http://www.adopenstatic.com/faq/800a0bb9step2.asp



Daniel



-----Original Message-----

From: Charles Feduke [mailto:webmaster@r...]

Sent: Tuesday, April 17, 2001 6:15 PM

To: ASP Databases

Subject: [asp_databases] global.asa, Constants, ADODB, oh my!







    I've made a few ADODB/ASP systems lately, and every single one of 

them has a *.asa file that includes all the global constants for ADODB.  

Every page that requires these variables, and some other global 

constants, must do a #include that particular *.asa file.



    I've seen in a couple places that you can tie a library (DLL, TLB, 

whatever) into the global.asa file.  To the best of my knowledge, the 

global.asa file is also only reloaded when it has been updated and a new 

request has been made.  My question is is there any way to bind the 

ADODB library to the global.asa file so the constants will be at hand at 

all times in all pages?  And if I do this, will there be any increase in 

page speed (even compile time/first request)?



    If so, then is it possible for me to make my own library of 

constants and tie them in in the same manner?



    Thanks.



- Chuck

Message #4 by "Peter Lanoie" <planoie@e...> on Tue, 17 Apr 2001 20:07:44 -0400
Chuck,



If you want to create your own library, then you could potentially just put

the definitions in the global.asa.  That's a quick and simple way of doing

it.



Peter



-----Original Message-----

From: Charles Feduke [mailto:webmaster@r...]

Sent: Tuesday, April 17, 2001 6:15 PM

To: ASP Databases

Subject: [asp_databases] global.asa, Constants, ADODB, oh my!







    I've made a few ADODB/ASP systems lately, and every single one of 

them has a *.asa file that includes all the global constants for ADODB.  

Every page that requires these variables, and some other global 

constants, must do a #include that particular *.asa file.



    I've seen in a couple places that you can tie a library (DLL, TLB, 

whatever) into the global.asa file.  To the best of my knowledge, the 

global.asa file is also only reloaded when it has been updated and a new 

request has been made.  My question is is there any way to bind the 

ADODB library to the global.asa file so the constants will be at hand at 

all times in all pages?  And if I do this, will there be any increase in 

page speed (even compile time/first request)?



    If so, then is it possible for me to make my own library of 

constants and tie them in in the same manner?



    Thanks.



- Chuck



Message #5 by "David E" <registerukh@h...> on Tue, 17 Apr 2001 23:46:04 -0400
Try the following in global.asa:





<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.1 

Library" UUID="{00000201-0000-0010-8000-00AA006D2EA4}" VERSION="2.1"-->



<SCRIPT LANGUAGE=VBScript RUNAT=Server>



'You can add special event handlers in this file that will get run 

automatically when

'special Active Server Pages events occur. To create these handlers, just 

create a

'subroutine with a name from the list below that corresponds to the event 

you want to

'use. For example, to create an event handler for Session_OnStart, you would 

put the

'following code into this file (without the comments):



'Sub Session_OnStart

'**Put your code here **

'End Sub

'Sub Application_OnStart

'End Sub

'EventName              Description

'Session_OnStart        Runs the first time a user runs any page in your 

application

'Session_OnEnd          Runs when a user's session times out or quits your 

application

'Application_OnStart    Runs once when the first page of your application is 

run for the first time by any user

'Application_OnEnd      Runs once when the web server shuts down



</SCRIPT>











>From: "Ken Schaefer" <ken@a...>

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] Re: global.asa, Constants, ADODB, oh my!

>Date: Wed, 18 Apr 2001 13:41:22 +1000

>

>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>:

>:     I've made a few ADODB/ASP systems lately, and every single one of 

>: them has a *.asa file that includes all the global constants for ADODB.  

>

>: Every page that requires these variables, and some other global 

>: constants, must do a #include that particular *.asa file.

>:

>:     I've seen in a couple places that you can tie a library (DLL, TLB, 

>: whatever) into the global.asa file.  To the best of my knowledge, the 

>: global.asa file is also only reloaded when it has been updated and a new 

>

>: request has been made.  My question is is there any way to bind the 

>: ADODB library to the global.asa file so the constants will be at hand at 

>

>: all times in all pages?  And if I do this, will there be any increase in 

>

>: page speed (even compile time/first request)?

>:

>:     If so, then is it possible for me to make my own library of 

>: constants and tie them in in the same manner?

>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

>Put something like this:

>

><!-- METADATA TYPE="TypeLib" FILE="c:\Program Files\Common

>Files\system\ado\msado15.dll" -->

>

>in your global.asa in the Application_OnStart sub

>All your ADO constants will be available to all pages in that application.

>Just unload the app in the IIS MMC Snapin to force the global.asa file to 

>be

>reloaded.

>

>Cheers

>Ken

>

>
Message #6 by "Charles Feduke" <webmaster@r...> on Wed, 18 Apr 2001 00:13:17 -0400
> in your global.asa in the Application_OnStart sub

> All your ADO constants will be available to all pages in that application.

> Just unload the app in the IIS MMC Snapin to force the global.asa file to

be

> reloaded.



    I know that a IIS 4 website must be restarted/app unloaded, but it

*seems* that I do not need to restart/unload app in an IIS 5 website

whenever I change the global.asa.  Would this still be the same case in this

instance (refering to the META DATA)?



    My next question: I will never have full control of the server

environment (except when developing) so I want to make a TypeLib that I can

put in the root directory and do a Server.MapPath("/myTypeLib.tlb") for the

constants.  Do you know of any good TypeLib tools (just need to expose

constants) and would it be possible to use .MapPath in the META DATA tag?



? Chuck



----- Original Message -----

From: "Ken Schaefer" <ken@a...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, April 17, 2001 11:41 PM

Subject: [asp_databases] Re: global.asa, Constants, ADODB, oh my!





> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> :

> :     I've made a few ADODB/ASP systems lately, and every single one of 

> : them has a *.asa file that includes all the global constants for ADODB.



> : Every page that requires these variables, and some other global 

> : constants, must do a #include that particular *.asa file.

> :

> :     I've seen in a couple places that you can tie a library (DLL, TLB, 

> : whatever) into the global.asa file.  To the best of my knowledge, the 

> : global.asa file is also only reloaded when it has been updated and a new



> : request has been made.  My question is is there any way to bind the 

> : ADODB library to the global.asa file so the constants will be at hand at



> : all times in all pages?  And if I do this, will there be any increase in



> : page speed (even compile time/first request)?

> :

> :     If so, then is it possible for me to make my own library of 

> : constants and tie them in in the same manner?

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

> Put something like this:

>

> <!-- METADATA TYPE="TypeLib" FILE="c:\Program Files\Common

> Files\system\ado\msado15.dll" -->

>

> in your global.asa in the Application_OnStart sub

> All your ADO constants will be available to all pages in that application.

> Just unload the app in the IIS MMC Snapin to force the global.asa file to

be

> reloaded.

>

> Cheers

> Ken

>

>
Message #7 by "Tomm Matthis" <matthis@b...> on Wed, 18 Apr 2001 06:57:53 -0400
If you're using Visual Interdev... go to the Projects menu and then

References... scroll to find ADO 2.x and check it off... it will place a

metatag in .asa file for you ...



IF you're not using VI, then check ASP101 for an example of using the

metatag (or you can seach the archives for this list at the WROX site..)



Tomm



> -----Original Message-----

> From: Charles Feduke [mailto:webmaster@r...]

> Sent: Tuesday, April 17, 2001 6:14 PM

> To: ASP Databases

> Subject: [asp_databases] global.asa, Constants, ADODB, oh my!

>

>

>

>     I've made a few ADODB/ASP systems lately, and every single one of 

> them has a *.asa file that includes all the global constants for ADODB.  

> Every page that requires these variables, and some other global 

> constants, must do a #include that particular *.asa file.

>

>     I've seen in a couple places that you can tie a library (DLL, TLB, 

> whatever) into the global.asa file.  To the best of my knowledge, the 

> global.asa file is also only reloaded when it has been updated and a new 

> request has been made.  My question is is there any way to bind the 

> ADODB library to the global.asa file so the constants will be at hand at 

> all times in all pages?  And if I do this, will there be any increase in 

> page speed (even compile time/first request)?

>

>     If so, then is it possible for me to make my own library of 

> constants and tie them in in the same manner?

>

>     Thanks.

>

> - Chuck

>


  Return to Index