home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _100ce7d9bb73bf31b2233406f687d46f < prev    next >
Text File  |  2004-06-01  |  2KB  |  55 lines

  1. <%@ LANGUAGE = PerlScript%>
  2. <html>
  3. <head>
  4. <meta name="GENERATOR" content="Tobias Martinsson">
  5.  
  6. <title>ADO Constants</title>
  7. </head>
  8. <body>
  9. <BODY BGCOLOR=#FFFFFF>
  10.  
  11. <!-- 
  12.     ActiveState PerlScript sample 
  13.     PerlScript:  The coolest way to program custom web solutions. 
  14. -->
  15.  
  16. <!-- Masthead -->
  17. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  18. <TR VALIGN=TOP ><TD WIDTH=400>
  19. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  20. </TD></TR></TABLE>
  21.  
  22. <HR>
  23.  
  24. <H3>ActiveX Data Objects (ADO) Constants</H3>
  25. Loads the ADO 2.5 constants and dumps them to the screen. This example is a small modification of the example of loading Word-constants available in the Win32::OLE::Const documentation. You can also write it as "use Win32::OLE::Const('Microsoft ActiveX Data Objects 2.5');".
  26.  
  27.     <p>
  28.     <%
  29.     use Win32::OLE::Const;
  30.  
  31.     my $ado = Win32::OLE::Const->Load('Microsoft ActiveX Data Objects 2.5');
  32.         foreach my $key (keys %$ado) {
  33.             $Response->Write(<<EOF); 
  34.                 $key = $ado->{$key} <br>
  35. EOF
  36.         }    
  37.     %>
  38.  
  39. <!-- +++++++++++++++++++++++++++++++++++++
  40. here is the standard showsource link - 
  41.     Note that PerlScript must be the default language --> <hr>
  42. <%
  43.     $url = $Request->ServerVariables('PATH_INFO')->item;
  44.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  45.     s/[\/\\](\w*\.asp\Z)//m;
  46.     $params = 'filename='."$1".'&URL='."$url";
  47.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  48. %>
  49. <A HREF="index.htm"> Return </A>
  50. <A HREF="showsource.asp?<%=$params%>">
  51. <h4><i>view the source</i></h4></A>  
  52.  
  53. </BODY>
  54. </HTML>
  55.