Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Givethat.com free gift ideas Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

Active Server Pages (ASP)

 

Declaring Type Libraries

In IIS5 and later, you can use the Global.asa file to declare a type library to bind to the application. Type libraries are files containing information about a particular COM object. Declaring a type library in Global.asa lets you access the constants for the object from any page in the application.

To declare a type library, you use the <METADATA> tag:

<!-- METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" -->

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart

Application("AppName")="Holiday Tips "

Application("Holiday")="Valentine's Day"

End Sub

Sub Application_OnEnd

Application("Holiday")=""

End Sub

</SCRIPT>

<OBJECT RUNAT="Server" SCOPE=Session ID=Ad1 PROGID="MSWC.AdRotator">

</OBJECT>

The UUID attribute specifies the unique identifier for the type library. You must use either the UUID attribute or the FILE attribute, which specifies the physical location of the library:

<!-- METADATA NAME=" Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" FILE="c:\program files\common files\system\ado\msado15.dll" -->

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart

Application("AppName")="Holiday Tips "

Application("Holiday")="Valentine's Day"

End Sub

Sub Application_OnEnd

Application("Holiday")=""

End Sub

</SCRIPT>

<OBJECT RUNAT="Server" SCOPE=Session ID=Ad1 PROGID="MSWC.AdRotator">

</OBJECT>

Other optional attributes are VERSION and LCID. Version specifies the major and minor version numbers (in the form VERSION="Major.Minor") and LCID specifies the locale identifier. If the local is not specified, the System locale is used.

Once you declare a type library, you can create an instance of the object in any ASP page in the application, and then access the constants that have been declared for the object:

<HTML>

<BODY>

<%

Set rs = Server.CreateObject("ADODB.Recordset")

rs.ActiveConnection = cnnStuff

rs.CursorType = adOpenKeyset

rs.LockType = adLockOptimistic

%>

</BODY>

</HTML>

 

 

by Summer Doucet

Find more free Internet tutorials from Learnthat.com.

More Information:

Help us by rating this tutorial: [---] [--] [+] [++] [+++]
[---] lowest; [+++] highest

 

 

 


Learn: Free Tutorials - Links to Free Tutorials
Understand: Free Technical Definitions - ExplainThat Whitepapers
Use: Certification Section - Discussion Forum

Visit Our Network Sites:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com