Article ID: 138541 - Last Review: December 7, 2005 - Revision: 6.2 How to use Odbcping.exe to verify ODBC connectivity to SQL ServerThis article was previously published under Q138541 On This PageSUMMARY
This article describes how to verify ODBC connectivity to SQL Server. More InformationMicrosoft SQL Server versions 6.0 and later contain a 32-bit utility named Odbcping.exe that you can use to verify connectivity to SQL Server through ODBC SQL Server drivers. With the Odbcping.exe utility, you verify whether ODBC and the Microsoft SQL Server driver are properly installed by connecting to a server by using the ODBC SQL Server Driver.Use the following command syntax to use the utility: odbcping {/S Server | /D DSN} /U LoginID /P Password The following parameters are in this command:
You can use the utility against SQL Server versions 4.21a or later, and you can use the Odbcping.exe utility from Microsoft Windows NT- or Microsoft Windows 95-based clients. If you use the /D switch, you can use the utility against any ODBC data source for the Win32 version (or versions) of the Microsoft SQL Server Driver (Sqlsrv32.dll). If you use /D for a data source while you are using a Win32 non-SQL Server driver, Odbcping.exe connects through the data source but it may experience difficulties when it tries to find the SQL Server version string. The utility does not work with Win16 ODBC drivers. Note This utility has been deprecated in SQL Server 2005. The following example demonstrates how to use this utility and how to verify the information that it provides. If you run the following command (where abc is the server name) c:\mssql\binn>odbcping -Sabc -Usa -Pxyz
Odbcping.exe returns the following information on a successful connection (SQL Server and driver version):
CONNECTED TO SQL SERVER ODBC SQL Server Driver Version: 02.65.0201 SQL Server Version: SQL Server for Windows NT 6.50 - 6.50.201 (Intel X86) Apr 3 1996 02:55:53 Copyright (c) 1988-1996 Microsoft Corporation For example, if you run the following command on a client that has the ODBC SDK sample applications installed: c:\mssql\binn>odbcping -Dsdk21-Access32 -Usa -Pxyz
and the connection is successful, the utility generates the following information:
CONNECTED TO SQL SERVER ODBC SQL Server Driver Version: 3.40.2505 SQL Server Version: |^w 137635
(http://support.microsoft.com/kb/137635/
)
ODBC SQL Server connection parameters
You can use the utility the same way that you use the ODBC Test utility in the ODBC SDK package: to help load different network libraries and to test the connectivity through ODBC. You can also use it to verify that the ODBC
modules are installed and configured correctly. However, you cannot run the utility in a Win16 client environment (for example: Microsoft Windows 3.1, or Microsoft Windows for Workgroups).
NOTE: If you use the 6.0 version of the Odbcping.exe utility to interpret connectivity errors, but you try to connect to a server that does not exist in the network, you do not receive the "pfNative" error so you cannot interpret the actual source of the problem. For more information about how to interpret pfNative code reported by connectivity errors, click the following article number to view the article in the Microsoft Knowledge Base: 137634
(http://support.microsoft.com/kb/137634/
)
Reading ODBC SQL Server driver network messages
Example:If you use the 6.0 version of the Odbcping.exe utility on an unsuccessful connection with named pipes, you receive the following error message:
C:\utils>odbcping -Sxyz -Usa -P COULD NOT CONNECT TO SQL SERVER SQLState: 01000 Error Message: [Microsoft][ODBC SQL Server Driver][dbnmpntw] ConnectionOpen (CreateFile()). SQLState: 08001 Error Message: [Microsoft][ODBC SQL Server Driver] Unable to connect to data source.
C:\utils>odbcping -Sxyz -Usa -P COULD NOT CONNECT TO SQL SERVER SQLState: 01000 Native Error: 2 Error Message: [Microsoft][ODBC SQL Server Driver][dbnmpntw] ConnectionOpen (CreateFile()). SQLState: 08001 Native Error: 6 Error Message: [Microsoft][ODBC SQL Server Driver][dbnmpntw] Specified SQL Server not found. | Article Translations
|
Back to the top
