|
This example shows the use of the
EditValidateRequiredFields property.
If you enter Add or Update mode and try to apply your editing, leaving an empty value for
the ProductName field, you will be alerted by a pop up window.
|
1 |
Chai
|
No
|
|
2 |
Chang
|
No
|
|
3 |
Aniseed Syrup
|
No
|
|
4 |
Chef Anton's Cajun Seasoning
|
No
|
|
5 |
Chef Anton's Gumbo Mix
|
Yes
|
|
|
|
This is the code implementing the example:
<!--#include file="VBSdb/inc.asp"-->
<%
VbsDbNew objVbsDb
objVbsDb( "MdbPath" ) = "data/nwind.mdb"
objVbsDb( "Sql" ) = "select ProductId,ProductName,Discontinued,SupplierId from Products"
objVbsDb( "GridHideFields" ) = "ProductId;SupplierId"
objVbsDb( "ViewNavigationButtons" ) = "first;next;prev;last;search;add;update;delete"
objVbsDb( "EditTableName" ) = "Products"
objVbsDb( "EditKeyFields" ) = "ProductId"
objVbsDb( "EditAddFieldDefaults" ) = "QuantityPerUnit|1;Discontinued|true"
objVbsDb( "EditValidateRequiredFields" ) = "ProductName|ProductName is required"
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.
|