|
This example shows the use of the
EditUpdateFieldDefaults property. Please, note that when you update an Employee,
the hire date is automatically set to the current date.
|
1 |
1
|
Davolio
|
Nancy
|
5/1/1992
|
|
2 |
2
|
Fuller
|
Andrew
|
8/14/1992
|
|
3 |
3
|
Leverling
|
Janet
|
4/1/1992
|
|
4 |
4
|
Peacock
|
Margaret
|
5/3/1993
|
|
5 |
5
|
Buchanan
|
Steven
|
10/17/1993
|
|
|
|
This is the code implementing the example:
<!--#include file="VBSdb/inc.asp"-->
<%
VbsDbNew objVbsDb
objVbsDb( "MdbPath" ) = "data/nwind.mdb"
objVbsDb( "Sql" ) = "select EmployeeID,LastName,FirstName,HireDate from Employees"
objVbsDb( "ViewNavigationButtons" ) = "first;next;prev;last;search;update"
objVbsDb( "EditTableName" ) = "Employees"
objVbsDb( "EditKeyFields" ) = "EmployeeID"
objVbsDb( "EditUpdateFieldDefaults" ) = "HireDate|" & date()
objVbsDb( "EditHideFields" ) = "HireDate"
%>
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.
|