|
Overview: RSFast - Templates
Example
by Charles Carroll
The library Rsfast can use a
template you supply to format data any way. Here is the code:
filename=/learn/rsfast_current/rsfast-templates.asp
<%@ enablesessionstate=false%>
<%option explicit%>
<%
response.buffer=true
server.scripttimeout=40
%>
<!--#include file="lib_rsfast.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>rsfast-templates</title>
</head>
<body bgcolor="#FFFFFF">
<%
dim rsparms,conntest
conntest="DSN=student;uid=student;pwd=magic"
set rsparms=server.CreateObject("Scripting.Dictionary")
rsparms.Add "conn", conntest
rsparms.add "sql", "select * from publishers where state='NY'"
rsparms.add "template_header", "<table border=1>"
rsparms.add "template_row_header", "<tr>"
rsparms.add "template_row_footer", "</tr>"
rsparms.add "template_col_header", "<td>"
rsparms.add "template_col_footer", "</td>"
rsparms.add "template_footer", "</table>"
rsparms.add "fieldnull", " "
rsparms.add "fieldblank", " "
rsparms.add "fld_city", "<td bgcolor='lightblue'><b>{0}</b><br></td>"
rsparms.add "fld_state", "<td><b>{0}</b><br></td>"
rsparms.add "colnames", "display"
Call RsFast(rsparms)
Call PerfDisplay(rsparms)
set rsparms=nothing
%>
</body>
</html>
The library file that does
all the work is at:
http://www.learnasp.com/freebook/asp/rsfast-lib.aspx
so go there to cut and paste the include file if needed.
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|