Querying with Visual Basic

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 illustrates several querying tasks for Indexing Service using the Query Helper, ActiveX Data Objects (ADO), and OLE DB Helper APIs. The VBQuery Sample has one primary form, Main, which contains the following controls.

  • A text box for the query text.
  • A text box for the selected scope of the query.
  • A command button for browsing to select the scope of the query.
  • A combo box for selecting the sort criteria. The default selection is "Rank[d]"
  • A combo box for selecting the query language. The possible selections are "Dialect 2", "SQL", and "Dialect 1". When either "Dialect" is selected, the query uses the Query Helper API. When "SQL" is selected, the query uses the ADO API.
  • A command button to begin execution of the query.
  • A command button to clear the current query settings.
  • A list view for displaying the results of the query.

The following topics discuss selected code segments from the Main form that perform actions specific to Indexing Service.

Secure Code Practices