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

  1. <%@ LANGUAGE = PerlScript%>
  2. <html>
  3. <head>
  4. <meta name="GENERATOR" content="ActiveState_Hack = Dick Hardt">
  5. <!-- 
  6.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  7.     Developed by ActiveState Internet Corp., http://www.ActiveState.com
  8. -->
  9. <title>Active X Database Object</title>
  10. </head>
  11. <body>
  12. <BODY BGCOLOR=#FFFFFF>
  13.  
  14. <!-- 
  15.     ActiveState PerlScript sample 
  16.     PerlScript:  The coolest way to program custom web solutions. 
  17. -->
  18.  
  19. <!-- Masthead -->
  20. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  21. <TR VALIGN=TOP ><TD WIDTH=400>
  22. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  23. </TD></TR></TABLE>
  24.  
  25. <H3>ActiveX Data Object (ADO)</H3>
  26. <hr>
  27. <%
  28.     $Conn = $Server->CreateObject("ADODB.Connection");
  29.     $Conn->Open( "ADOSamples" );
  30.     $sql = "select ProductName, ProductDescription from Products where ProductType in ('Boot', 'Tent')";
  31.     $RS = $Conn->Execute($sql);
  32.  
  33.  
  34.     %>
  35.     
  36.     <P><h3>    Here are the results from the query:<BR><i>  <%= $sql %></i></h3><P>
  37.     <TABLE BORDER>
  38.  
  39.     <%
  40.     while ( ! $RS->{EOF} ) {
  41.         %><TR><TD>
  42.         <%=$RS->Fields(0)->{Value}%></TD><TD>
  43.         <%=$RS->Fields(1)->{Value}%></TD></TR>
  44.         <%$RS->MoveNext;
  45.     }
  46.  
  47.     $RS->close;
  48.     $Conn->close;%>
  49.  
  50. </TABLE>
  51.  
  52. <!-- +++++++++++++++++++++++++++++++++++++
  53. here is the standard showsource link - 
  54.     Note that PerlScript must be the default language --> <hr>
  55. <%
  56.     $url = $Request->ServerVariables('PATH_INFO')->Item;
  57.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->Item;
  58.     s/[\/\\](\w*\.asp\Z)//m;
  59.     $params = 'filename='."$1".'&URL='."$url";
  60.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  61. %>
  62. <A HREF="index.htm"> Return </A>
  63. <A HREF="showsource.asp?<%=$params%>">
  64. <h4><i>view the source</i></h4></A>  
  65.  
  66. </BODY>
  67. </HTML>
  68.