|
This example shows the use of the
EditAddScreenRepeat property.
If you insert an item and press 'apply add', the item is silently added to the database and
the add screen is presented to you again. Click the 'Cancel' button to go to
the Grid/Form page. Then go to the last Grid page to see your added records.
|
1 |
1
|
Chai
|
|
2 |
2
|
Chang
|
|
3 |
3
|
Aniseed Syrup
|
|
4 |
4
|
Chef Anton's Cajun Seasoning
|
|
5 |
5
|
Chef Anton's Gumbo Mix
|
|
|
|
This is the code implementing the example:
<!--#include file="VBSdb/inc.asp"-->
<%
VbsDbNew objVbsDb
objVbsDb( "MdbPath" ) = "data/nwind.mdb"
objVbsDb( "Sql" ) = "select productId,ProductName from Products"
objVbsDb( "ViewNavigationButtons" ) = "first;next;prev;last;search;add"
objVbsDb( "EditTableName" ) = "Products"
objVbsDb( "EditValidateRequiredFields" ) = "ProductName|ProductName is required!"
objVbsDb( "EditAddFieldDefaults" ) = "SupplierId|1;CategoryId|1;QuantityPerUnit|1;discontinued|true"
objVbsDb( "EditReadOnlyFields" ) = "SupplierId;Discontinued"
objVbsDb( "EditAddScreenRepeat" ) = true
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.
|