VBQuery Sample
Note
Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.
The VBQuery sample is an example Windows application written in Visual Basic that illustrates how to query Indexing Service using the Indexing Service query languages and the ActiveX Data Objects (ADO) and Query Helper APIs.
Source: mssdk\samples\winbase\indexing\VBQuery\
To build and run the sample
- In the Visual Basic development environment, open the VBQuery.vbp project in the source path of the sample.
- In the File menu, select Make VBQuery.exe.
- In the Make Project dialog box, click OK.
- In the Run menu, click Start.
To execute queries using the sample
- Make sure that Indexing Service is started.
- In the Query text box, enter the query text.
- In the Scope text box, enter the folder where you want to start the search. You can click the "..." button to display a dialog box to find a folder for the scope of the search.
- In the Sort list, select the way you want the application to sort the search hits.
- In the list next to the Sort list, select the Indexing Service query language used to specify the query.
- Click Go to run the specified query or Clear to specify a new query.
Programming Notes
The VBQuery sample illustrates how you can use the Query and Utility automation objects of the Query Helper API to build applications that query a catalog. The sample can process queries specified in any of the following three query languages.
- Indexing Service Query Language, Dialect 1 or Dialect 2
- SQL Query Language
In addition, the sample uses ADO objects to handle the recordsets returned by the Query Helper Automation objects.
This sample also demonstrates making a dynamic-link library (DLL) call to the LocateCatalogs function of the OLE DB Helper API. The application uses this function to locate catalogs suitable for the scope specified by the user.