Share via


Working with ASP Applications

Working with ASP Applications

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The various Component Object Model (COM) components, such as Microsoft® ActiveX® Data Objects (ADO) 2.5 and CDO for Exchange 2000 Server (CDOEX) provide extensive libraries of constants in their associated type libraries. Using the new Microsoft Internet Information Services (IIS) Web page keyword METADATA, you can easily import these constants into your ASP applications and make them globally available when you write scripts.

Note  In Microsoft Exchange System Manager: Turn on Script Execute Permissions for ASP and Scripts and Executables for Internet Server Application Programming Interface (ISAPI) filters. Otherwise, you will get a 403 Permission Denied error.

To import these constants, you place a METADATA directive, such as the following, at the top of your ASP file or in your GLOBAL.ASA file:

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Exchange 2000 Type Library" -->
<!--METADATA TYPE="typelib" UUID="CD001000-8B95-11D1-82DB-00C04FB1625D" NAME="Microsoft CDO Workflow Objects for Microsoft Exchange"-->
<!--METADATA TYPE="typelib" UUID="25150F00-5734-11D2-A593-00C04F990D8A" NAME="Microsoft CDO for Exchange Management Library"-->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->

This METADATA directive has the effect of importing the type information into the page at run time, so you can use module constant names in your scripts without having to define them beforehand.

Example

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="Microsoft CDO for Exchange 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="CD001000-8B95-11D1-82DB-00C04FB1625D" NAME="Microsoft CDO Workflow Objects for Microsoft Exchange"-->
<!--METADATA TYPE="typelib" UUID="25150F00-5734-11D2-A593-00C04F990D8A" NAME="Microsoft CDO for Exchange Management Library"-->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<HTML>
 <BODY>
  <H1>Test the METADATA Directive Page</H1>
  <p>Here are some of the field name string constants within CDOEX type library :</p>

  <H4>Some CDO for Exchange 2000 Server String Constants</H4>
  <TABLE>
   <TR><TD><b>cdoTo</b>   </TD><TD><%=cdoTo%>    </TD></TR>
   <TR><TD><b>cdoFrom</b> </TD><TD><%=cdoFrom%>  </TD></TR>
   <TR><TD><b>cdoUTF_8</b></TD><TD><%=cdoUTF_8%></TD></TR>
  </TABLE>

  <H4>Some CDO for Exchange Enumeration Constants</H4>
  <TABLE>
   <TR><TD><b>cdoSendUsingPickup</b></TD><TD><%=cdoSendUsingPickup%>  </TD></TR>
   <TR><TD><b>cdoSendUsingPort</b></TD><TD><%=cdoSendUsingPort%></TD></TR>
  </TABLE>

  <H4>Some ADO Enumeration Constants</H4>
  <TABLE>
   <TR><TD><b>adReadAll</b>    </TD><TD><%=adReadAll%>    </TD></TR>
   <TR><TD><b>adReadLine</b>   </TD><TD><%=adReadLine%>   </TD></TR>
   <TR><TD><b>adTypeBinary</b> </TD><TD><%=adTypeBinary%> </TD></TR>
   <TR><TD><b>adTypeText</b>   </TD><TD><%=adTypeText%>   </TD></TR>
  </TABLE>

 </BODY>
</HTML>

To add type information from other type libraries, simply add another METADATA directive to the ASP file.

Putting these directives in your GLOBAL.ASA file makes all these constants available across the current ASP application.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.