|
In this example
the SupplierID field is ambiguous because it belongs to both tables of the Sql
join statement. Since this examples uses an Ole Db over Jet provider,
Products.SupplierID is written to disambiguate the SupplierID field.
As you can see, SearchAliasFields property is not needed to disambiguate field names,
if your provider is Ole Db over Jet.
|
1 |
Chai
|
Exotic Liquids
|
|
2 |
Chang
|
Exotic Liquids
|
|
3 |
Aniseed Syrup
|
Exotic Liquids
|
|
4 |
Chef Anton's Cajun Seasoning
|
New Orleans Cajun Delights
|
|
5 |
Chef Anton's Gumbo Mix
|
New Orleans Cajun Delights
|
|
|
|
This is the code implementing the example:
<!--#include file="VBSdb/inc.asp"-->
<%
VbsDbNew objVbsDb
objVbsDb( "MdbPath" ) = "data/nwind.mdb"
objVbsDb( "Sql" ) = "select * from Products inner join Suppliers on Products.SupplierID=Suppliers.SupplierID"
objVbsDb( "GridFields" ) = "ProductName,CompanyName"
objVbsDb( "ViewNavigationButtons" ) = "first;prev;next;last;search;removeFilter;add;update,delete"
objVbsDb( "ViewNavigationPosition" ) = "top"
objVbsDb( "SearchFields" ) = "ProductName;Products.SupplierID"
objVbsDb( "EditTableName" ) = "Products"
objVbsDb( "EditKeyFields" ) = "ProductID"
objVbsDb( "EditValidateRequiredFields" ) = "ProductName|ProductName is required!"
objVbsDb( "InputSelectFields" ) = "Products.SupplierID|select SupplierId,CompanyName from Suppliers"
objVbsDb( "GlobalFieldHeaders" ) = "Products.SupplierID|Supplier"
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.
|