Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Ssadovb.exe Demonstrates Using OLEDB & ADO in Visual Basic


View products that this article applies to.

This article was previously published under Q184385

↑ Back to the top


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.

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591� How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

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.

↑ Back to the top


Keywords: KB184385, kbinfo, kbfile, kbdownload

↑ Back to the top

Article Info
Article ID : 184385
Revision : 6
Created on : 8/9/2004
Published on : 8/9/2004
Exists online : False
Views : 495