52 | Chapter 4 Enhanced Layer Functionality
Sample 2: Running a Custom Query Against an
OLE Database
This sample again illustrates the convenience of adding user-supplied param-
eters when running the a custom spatial query, this time against an OLE data-
base. The parameters shown in the following Advanced Settings dialog box
are entered instead of the user’s having to type literal values contained
within columns and feature tables.
Sample 2: OLE/DB custom spatial query
The actual custom query is:
SELECT ID, %LATCOL, %LONCOL FROM %FEATTABLE WHERE (%LATCOL > %MINY
AND %LATCOL < %MAXY AND %LONCOL > %MINX AND %LONCOL < %MAXX)
In the preceding sample custom spatial query, the following parameters are
used:
■ %LATCOL: Comes from the Latitude Column control
■ %LONCOL: Comes from the Longitude Column control
■ %FEATTABLE: Comes from the Feature Table control
■ %MINX: Comes from the minimum X extents of the client window
■ %MINY: Comes from the minimum Y extents of the client window
■ %MAXX: Comes from the maximum X extents of the client window
■ %MAXY: Comes from the maximum Y extents of the client window