Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Understanding Your Website

Spooky's Databases > Advanced Tips > Modify the DRW


Although the wizard is used to set up your DRW, the code itself is actually quite customizable (in comparison to FP98!)

Here we have a look at the code, and what changing it will probably result in.

Learn something new and exciting using online educational software where you can get a degree through an online programming school or even from a online law school.

Remember, any changes to the DRW code could render that page useless or cause unreliable results. So as always keep a backup!

Once changes are made, more often than not, you cannot reuse the DRW to change simple formatting without rebuilding the whole DRW!

Other topics are :


Example code

To keep things simple, our example consists of a 1 cell table containing one field (RecordID) from the North wind database.
All we are demonstrating here, is what the code is basically used for.

 <table width="100%" border="1">
<thead>
<tr>
<td><b>
ProductID</b></td>
</tr>
</thead>
<tbody>

What follows here, is the main code for querying the database, and setting the display options.
Most of these options can be manually edited.


<!--webbot bot="DatabaseRegionStart" startspan
s-columnnames="ProductID,ProductName,SupplierID,CategoryID,
QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder
,ReorderLevel,Discontinued"
s-columntypes="3,200,3,3,200,6,2,2,2,11"
s-dataconnection="Sample"
b-tableformat="TRUE"
menuformat="FALSE"
s-menuchoice
s-menuvalue
b-tableborder="TRUE"
b-tableexpand="TRUE"
b-tableheader="TRUE"
b-listlabels="TRUE"
b-listseparator="TRUE"
i-ListFormat="6"
b-makeform="FALSE"
s-recordsource="Products"
s-displaycolumns="ProductID"
s-criteria s-order s-sql="SELECT * FROM Products"
b-procedure="FALSE"
clientside SuggestedExt="asp"
s-DefaultFields
s-NoRecordsFound="No records returned."
i-MaxRecords="256"
i-GroupSize="5"
BOTID="0"
u-dblib="_fpclass/fpdblib.inc"
u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc"
tag="TBODY"
local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Database Results regions will not preview unless this page is fetched from a Web server with a web browser. The following table row will repeat once for every record returned by the query.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" -->

An include page is added. This is the library of asp code that does some of the work.

<!--#include file="_fpclass/fpdblib.inc"-->

The 'red' code below, is the generated asp code from the DRW, and is passed to the include pages used to process the variables. It CAN NOT be modified here, as the code is generated by the web bot.
If you need to modify this code, you have 2 options.

1) Change the grey code above
2) Use the Spooky diet

<%
fp_sQry="SELECT * FROM Products"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Sample"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

An include page is added

<!--#include file="_fpclass/fpdbrgn1.inc"-->

Now we get into the actual page display code.
The first line signifies that the DRW is about to start.


<!--webbot bot="DatabaseRegionStart" i-CheckSum="25969" endspan -->

Our default setting that we have used is "Table", so a row and cell are generated.


<tr>
<td>

The following gray code is used by the wizard to format and display each database column record.


<!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="ProductID,ProductName,SupplierID,CategoryID
,QuantityPerUnit,UnitPrice,UnitsInStock,
UnitsOnOrder,ReorderLevel,Discontinued"
s-column="ProductID"
b-tableformat="TRUE"
b-hasHTML="FALSE"
clientside
local_preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;ProductID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;ProductID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" -->

The red code below is again asp. It is the code that does the actual work, writing the database value to the page.

<%=FP_FieldVal(fp_rs,"ProductID")%>

Now we close this cell and then we close the row

<!--webbot bot="DatabaseResultColumn" i-CheckSum="17683" endspan -->

</td>
</tr>

We tell the DRW we are finished with this row, and if any more are to follow, we will loop through them until finished.
Otherwise, display the footer.

<!--webbot bot="DatabaseRegionEnd" startspan
b-tableformat="TRUE"
b-menuformat="FALSE"
u-dbrgn2="_fpclass/fpdbrgn2.inc"
 i-groupsize="5"
clientside tag="TBODY"
local_preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64&gt;&lt;FORM&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot; |&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;| &quot;&gt; [1/5]&lt;/NOBR&gt;&lt;/FORM&gt;&lt;/td&gt;&lt;/tr&gt;"
preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot; |&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;| &quot;&gt; [1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" -->

And the final include page is added

<!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" i-CheckSum="62730" endspan -->

</tbody>
</table>


Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.