|
This example shows the use of the
FormTemplate property. Please, note
that FormTemplate allows you to line up more than one field per form row.
|
1 |
Chai
|
|
2 |
Chang
|
|
3 |
Aniseed Syrup
|
|
4 |
Chef Anton's Cajun Seasoning
|
|
5 |
Chef Anton's Gumbo Mix
|
|
|
| Product Name: |
Chai |
| Quantity per Unit: |
10 boxes x 20 bags |
Units in Stock: |
39 |
| Units on Order: |
0 |
Reorder Level: |
10 |
| Discontinued: |
No |
Unit Price: |
18 |
|
This is the code implementing the example:
<!--#include file="VBSdb/inc.asp"-->
<%
VbsDbNew objVbsDb
objVbsDb( "MdbPath" ) = "data/nwind.mdb"
objVbsDb( "Sql" ) = "select * from Products"
objVbsDb( "GridFields" ) = "ProductName"
objVbsDb( "FormTemplate" ) = "FormTemplateExample.htm"
objVbsDb( "ViewFieldFormats" ) = "UnitPrice|<font color=red>{{UnitPrice}}</font>"
VbsDb objVbsDb
%>
This demonstrative program connects to
Nwind.mdb, the well known Microsoft Access sample database: the names of companies,
products, people,
characters, and/or data mentioned herein are fictious and are in no way
intended to represent any real individual, company, product, or event.
To download a copy of Nwind.mdb, please visit
Microsoft's site.
This is the html code for FormTemplateExample.htm, the template file used for this example:
<TABLE cellSpacing=1 cellPadding=1 width="100%" border=1>
<TR>
<TD align=right>Product Name:</TD>
<TD colSpan=3 align=left><VbsDbFieldValue>ProductName</VbsDbFieldValue></TD>
</TR>
<TR>
<TD align=right>Quantity per Unit:</TD>
<TD><VbsDbFieldValue>QuantityPerUnit</VbsDbFieldValue></TD>
<TD align=right>Units in Stock:</TD>
<TD><VbsDbFieldValue>UnitsInStock</VbsDbFieldValue></TD>
</TR>
<TR>
<TD align=right>Units on Order:</TD>
<TD><VbsDbFieldValue>UnitsOnOrder</VbsDbFieldValue></TD>
<TD align=right>Reorder Level:</TD>
<TD><VbsDbFieldValue>ReorderLevel</VbsDbFieldValue></TD>
</TR>
<TR>
<TD align=right> Discontinued:</TD>
<TD><VbsDbFieldValue>Discontinued</VbsDbFieldValue></TD>
<TD align=right>Unit Price:</TD>
<TD><VbsDbFieldValue>UnitPrice</VbsDbFieldValue></TD>
</TR>
</TABLE>
|