This example shows the use of the
GridTemplate property.
The GridTemplate on line
demo shows a more advanced example. You can instead find a GridTemplate with
conditional formatting here.
| 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 |
|
| Product Name: |
Chang |
| Quantity per Unit: |
24 - 12 oz bottles |
Units in Stock: |
17 |
Units on Order: |
40 |
| Reorder Level: |
25 |
Discontinued: |
No |
Unit Price: |
19 |
|
| Product Name: |
Aniseed Syrup |
| Quantity per Unit: |
12 - 550 ml bottles |
Units in Stock: |
13 |
Units on Order: |
70 |
| Reorder Level: |
25 |
Discontinued: |
No |
Unit Price: |
10 |
|
| Product Name: |
Chef Anton's Cajun Seasoning |
| Quantity per Unit: |
48 - 6 oz jars |
Units in Stock: |
53 |
Units on Order: |
0 |
| Reorder Level: |
0 |
Discontinued: |
No |
Unit Price: |
22 |
|
| Product Name: |
Chef Anton's Gumbo Mix |
| Quantity per Unit: |
36 boxes |
Units in Stock: |
0 |
Units on Order: |
0 |
| Reorder Level: |
0 |
Discontinued: |
Yes |
Unit Price: |
21.35 |
|
|
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( "ViewMode" ) = "Grid"
objVbsDb( "GridTemplate" ) = "GridTemplateExample.htm"
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 GridTemplateExample.htm, the template file used for this example:
<VbsDbGridRow>
<TABLE cellSpacing=1 cellPadding=1 width="100%" border=1>
<TR>
<TD align=right>Product Name:</TD>
<TD colSpan=5 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>
<TD align=right>Units on Order:</TD>
<TD><VbsDbFieldValue>UnitsOnOrder</VbsDbFieldValue></TD>
</TR>
<TR>
<TD align=right>Reorder Level:</TD>
<TD><VbsDbFieldValue>ReorderLevel</VbsDbFieldValue></TD>
<TD align=right>Discontinued:</TD>
<TD><VbsDbFieldValue>Discontinued</VbsDbFieldValue></TD>
<TD align=right>Unit Price:</TD>
<TD><VbsDbFieldValue>UnitPrice</VbsDbFieldValue></TD>
<TR>
</TABLE>
</VbsDbGridRow>
|