FILE: Idxadovb.exe: Using Index Server OLE DB Provider and ADO i

Last reviewed: March 5, 1998
Article ID: Q179326
The information in this article applies to:
  • Microsoft OLE DB Provider for Index Server 2.0

SUMMARY

The Idxadovb.exe sample demonstrates how to use an ActiveX Data Objects (ADO) recordset with the OLE DB Provider for Index Server (MSIDXS) in a Visual Basic application to query Index Server 2.0.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

~ Idxadovb.exe

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

This sample lets a user specify a query string, scope, and sort order. The sample shows the filename, path, size and last write-time for all documents in the result set. Results can be sorted by rank (default), filename, path, size or write-time based on the current selection in Sort dialog box.

The following code opens an ADO recordset and submits a query to the Index Server using the OLE DB provider:

   Dim RS As New ADODB.Recordset
   Const adOpenForwardOnly = 0
   Connect = "provider=msidxs"
   CommandText = "SELECT Filename, Path, Size, Write FROM Scope('" +
   Chr(34) + Scope.Text + Chr(34) + "') WHERE " + QueryText.Text + "
   ORDER BY " + Sort.Text

   ' Print SQL text in debug window.
   Debug.Print CommandText
   RS.Open CommandText, Connect, adOpenForwardOnly

Run the sample and type the query in the Query text box. Select a scope (the folder containing the documents to search) and click GO. Either the search results will be displayed or the "No matches found..." message. The sample also prints the current SQL statement sent by the application in the debug (immediate) window in Visual Basic 5.0 IDE.

REFERENCES

For more information on Index Server, refer to Index Server documentation in the Windows NT Option Pack documentation. The chapter "SQL Access to Index Server Data" is the best reference for SQL query syntax for Index Server.

Keywords          : oledbMisc
Technology        : ole
Version           : WINDOWS:2.0
Platform          : WINDOWS
Issue type        : kbfile


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.