home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
c't freeware shareware 1997
/
CT_SW_97.ISO
/
pc
/
software
/
entwickl
/
win95
/
plsei306.exe
/
aspSamples
/
ado1.asp
next >
Wrap
Text File
|
1997-03-22
|
2KB
|
86 lines
<%@ LANGUAGE = PerlScript%>
<html>
<head>
<meta name="GENERATOR" content="ActiveWare_Hack = Dick Hardt">
<!--
Copyright (c) 1996, Microsoft Corporation. All rights reserved.
Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
-->
<title>Active X Database Object</title>
</head>
<body>
<BODY BGCOLOR=#FFFFFF>
<!--
ActiveWare PerlScript sample
PerlScript: The coolest way to program custom web solutions.
-->
<!-- Masthead -->
<TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
<TR VALIGN=TOP ><TD WIDTH=400>
<A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveWare PerlScript" BORDER=0></A><P>
</TD></TR></TABLE>
<HR>
<H3>ActiveX Data Object (ADO)</H3>
<!--
<%
$ErrorNum = $!;
$ErrorStr = 'Err:'.$!;
if ($Conn eq undef) {
$val = 'undef';
} else {
$val = $Conn;
}
%>
$Conn = <%= $val %> <br>
$ErrorNum = <%= $ErrorNum %> <br>
$ErrorStr = <%= $ErrorStr %> <br>
-->
<%
$Conn = $Server->CreateObject("ADODB.Connection");
$Conn->Open( "ADOSamples" );
$RS = $Conn->Execute( "SELECT * FROM Orders" );%>
<P>
<TABLE BORDER=1>
<TR>
<%
$count = $RS->Fields->Count;
for ( $i = 0; $i < $count; $i++ ) {
%><TD><B><%= $RS->Fields($i)->Name %></B></TD><%
}; %> </TR> <%
while ( ! $RS->EOF ) {
%> <TR> <%
for ( $i = 0; $i < $count; $i++ ) {
%><TD VALIGN=TOP>
<%= $RS->Fields($i)->value %></TD><%
};
%> </TR> <%
$RS->MoveNext;
};
$RS->Close;
$Conn->Close;
%>
</TABLE>
<!-- +++++++++++++++++++++++++++++++++++++
here is the standard showsource link -
Note that PerlScript must be the default language --> <hr>
<%
$url = $Request->ServerVariables('PATH_INFO')->item;
$_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
s/[\/\\](\w*\.asp\Z)//m;
$params = 'filename='."$1".'&URL='."$url";
$params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
%>
<A HREF="index.htm"> Return </A>
<A HREF="showsource.asp?<%=$params%>">
<h4><i>view the source</i></h4></A>
</BODY>
</HTML>