SAMPLE: Adotest.exe Provides Command Line Functionality for Testing ADO Components (298494)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.5
  • ActiveX Data Objects (ADO) 2.6

This article was previously published under Q298494

SUMMARY

The Adotest.exe file provides a command line tool (and source code for the tool) that uses ADO components to connect to a back end server. This tool:
  • Tests whether ADO is properly installed on a computer. ADO is installed on a computer by Microsoft Data Access Components (MDAC).
  • Can be used to confirm whether a client can connect to a back end database, using a specific provider to get the data.
  • Does not have any graphical user interface (GUI) or Microsoft Foundation Class (MFC) dependencies, and works as long as ADO is installed properly on the computer.
  • Can be used to ping the back end data store by using the OLEDB Provider. The number of pings can be specified. The tool can be used to resolve intermittent ADO connectivity problems that are particularly associated with memory issues on the client by using a specific provider.
NOTE: This tool is compiled by using ADO 2.6. If you want to use the tool with a version of ADO earlier than MDAC 2.6, recompile the tool by using the source code files.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: Jun-22-2001

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. NOTE: In addition to ADO components, you may need Microsoft Visual C run-time components to use this utility. For additional information%1, click the article number%2 below to view the article%2 in the Microsoft Knowledge Base:

%3 %4

The Adotest.exe file contains the following files:

File nameSize
AdoTest.dsw537 bytes
AdoTest.dsp4.27 KB
AdoTest.cpp10.8 KB
AdoTest2.exe144 KB


The tool includes the following 6 options:
  • Test with default settings uses the default settings as shown by the tool.
  • Change default settings allows the user to change default settings. Type the provider name (for example, MSDASQL, SQLOLEDB, or Microsoft.Jet.OLEDB.4.0).

    This utility is initially tested with MSDASQL, SQLOLEDB, and a Jet 4.0 provider. It works with number of providers if proper parameters are provided. If you use a different provider or advanced options, you may need to enhance the code.

    NOTE: Only use the fields as appropriate and required by the provider. If the field is not required, press ENTER to skip it. For example, when you use Jet Provider, you do not use the Initial Catalog parameter. The following is an example that uses the SQL OLEDB provider:
    OLEDB Provider  :SQLOLEDB
    Data Source     :YourSQLServer
    Init Catalog    :YourSQLDatabase
    User ID         :YourUserID
    Password        :YourPassword
    Sql Query       :Select * From YourTable
    					
    The following is an example that uses the Jet Provider:
    OLEDB Provider  :Microsoft.Jet.OLEDB.4.0
    Data Source     :<YourPathToYourMDBFile>\\YourAccessDatabase.mdb
    Init Catalog    :
    User ID         :
    Password        :
    Sql Query       :Select * from YourTable
    					
  • Change default settings using DataLink Wizard uses the DataLink wizard to generate the connection string. If you are using Password, make sure to select Allow Saving Password in the DataLink Wizard dialog box.
  • ADO Ping connects and disconnects from the back end data store a specified number of times.
  • Help shows an online help.
  • Quit exits the tool.

REFERENCES

For more information on MDAC, see the following Microsoft Web site:

Modification Type:MinorLast Reviewed:8/5/2004
Keywords:kbdownload kbdownload kbfile kbsample KB298494