home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / pc / software / entwickl / win95 / plsei306.exe / aspSamples / ado2.asp < prev    next >
Text File  |  1997-03-22  |  2KB  |  69 lines

  1. <%@ LANGUAGE = PerlScript%>
  2. <html>
  3. <head>
  4. <meta name="GENERATOR" content="ActiveWare_Hack = Dick Hardt">
  5. <!-- 
  6.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  7.     Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
  8. -->
  9. <title>Active X Database Object</title>
  10. </head>
  11. <body>
  12. <BODY BGCOLOR=#FFFFFF>
  13.  
  14. <!-- 
  15.     ActiveWare 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="ActiveWare PerlScript" BORDER=0></A><P>
  23. </TD></TR></TABLE>
  24.  
  25. <H3>ActiveX Data Object (ADO)</H3>
  26. <OBJECT RUNAT=Server ID=Conn CLASSID="Clsid:00000293-0000-0010-8000-00AA006D2EA4"></OBJECT>
  27.  
  28.     <%
  29.     $Conn->Open( "ADOSamples" );
  30.     $RS = $Conn->Execute( "SELECT * FROM Orders" );%>
  31.  
  32.     <P>
  33.     <TABLE BORDER=1>
  34.  
  35.         <TR>
  36.     <%for ( $i = 0; $i < $RS->Fields->Count; $i++ ) {%>
  37.             <TD VALIGN=TOP><%= $RS->Fields($i)->name %></TD>
  38.         <%}%>
  39.         </TR>
  40.  
  41.     <%while ( ! $RS->EOF ) {%>
  42.         <TR>
  43.  
  44.         <%for ( $i = 0; $i < $RS->Fields->Count; $i++ ) {%>
  45.             <TD VALIGN=TOP><%= $RS->Fields($i)->value %></TD>
  46.         <%}%>
  47.  
  48.         </TR>
  49.         <%$RS->MoveNext;
  50.     }%>
  51.  
  52. </TABLE>
  53. <!-- +++++++++++++++++++++++++++++++++++++
  54. here is the standard showsource link - 
  55.     Note that PerlScript must be the default language --> <hr>
  56. <%
  57.     $url = $Request->ServerVariables('PATH_INFO')->item;
  58.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  59.     s/[\/\\](\w*\.asp\Z)//m;
  60.     $params = 'filename='."$1".'&URL='."$url";
  61.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  62. %>
  63. <A HREF="index.htm"> Return </A>
  64. <A HREF="showsource.asp?<%=$params%>">
  65. <h4><i>view the source</i></h4></A>  
  66.  
  67. </BODY>
  68. </HTML>
  69.