Ssadovb.exe Demonstrates Using OLEDB & ADO in Visual Basic

ID: Q184385


The information in this article applies to:
  • Microsoft OLE DB Provider for Site Server, version 3.0
  • ActiveX Data Objects (ADO), version 1.5
  • Microsoft Data Access Components version 2.1 SP2


SUMMARY

Ssadovb.exe is a sample file that demonstrates how to use an ActiveX Data Objects (ADO) Recordset with the OLE DB Provider for Site Server (MSSearchSQL) in a Visual Basic application to query Web site data.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

Ssadovb.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Sample File Information

The sample lets a user specify a query string, scope and sort order. The sample shows the filename, path and the last write-time for all documents in the result set. You may also sort the results by rank (default), filename, path or write-time based on the current selection in the Sort box.

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

   Dim RS As New ADODB.Recordset

           Const adOpenForwardOnly = 0
           Connect = "provider=MSSEARCHSQL;data source=KMSampleCatalog1;"
    CommandText = "SELECT Filename, Path, Write FROM Scope('" + Chr(34) +
    Scope.Text + Chr(34) + "') WHERE " + QueryText.Text + " ORDER BY " +
    Sort.Text

        ' Print SQL text in the debug window.
           Debug.Print CommandText
           RS.Open CommandText, Connect, adOpenForwardOnly 
Run the sample and type the query in the Query text box. Click the Go command button. Either the search results display or the following message appears:
No matches found...
The sample also prints the current SQL statement sent by the application in the debug (immediate) window in Visual Basic 5.0 IDE.

To make sure the catalog is ready for the search, run the Site Server Admin tool using the following steps:
  1. Go to the Programs\Microsoft Site Server\Administration\Site Server Service Admin (MMC) folder.


  2. Expand the Search folder and select a catalog from the "Catalog Build Server" folder.


  3. Use the Task/Start build shortcut menu to build the catalog.


  4. Go to the Search Server folder and use the Task/Update shortcut menu to update the search catalogs.


  5. Use the catalog name in your ADO connection string's data source property as shown in the code example above.


Additional query words: adovb

Keywords : kbfile
Version : WINDOWS:1.5,2.1 SP2,3.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.