|
This example shows the use of the
EditAddTemplate property. Please, note
that using the EditAddTemplate property, you are free to customize your add form as you prefer.
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( "ViewNavigationButtons" ) = "first;prev;next;last;removeFilter;search;add"
objVbsDb( "GridFields" ) = "ProductName"
objVbsDb( "EditTableName" ) = "Products"
objVbsDb( "EditValidateRequiredFields" ) = "ProductName|ProductName is required!"
objVbsDb( "EditAddTemplate" ) = "EditAddTemplateExample.htm"
objVbsDb( "GlobalStartScreen" ) = "Add"
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 EditAddTemplateExample.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>
<TR>
<TD align=center colspan=4><VbsDbInputSubmit> <VbsDbInputReset> <VbsDbInputCancel></TD>
</TR>
</TABLE>
|