INF: ODBCPING.EXE to Verify ODBC Connectivity to SQL ServerID: Q138541
|
Microsoft SQL Server versions 6.0 and 6.5 contain a 32-bit utility called ODBCPING.EXE that you can use to verify connectivity to MS SQL Server through Microsoft ODBC SQL Server drivers.
The Odbcping.Exe utility is used to check whether ODBC and
the Microsoft SQL Server driver are properly installed by
connecting to a server using the ODBC SQL Server Driver.
The command syntax to use the utility is:
odbcping {/Sservername | /Ddatasource} /Ulogin_id /Ppassword
where /U and /P are the SQL Server login ID and password, /S
is the network name of the server running SQL Server, and /D
is the name of an ODBC data source. Users must specify
either /S or /D, but not both. The version of ODBCPING that
ships with SQL Server 6.0 will only accept the /S, /U, and
/P switches, it will not accept the /D parameter. Note that
the switches are case sensitive. The 6.0 version of the
utility is documented in the ODBC SQL Server Driver help
file Drvssrvr.Hlp, which comes with SQL Server versions 6.0
and 6.5, in the section "Connecting to a Data Source." It is
also in the SQL Server Books Online "Administrator's
Companion," Part 6, Chapter 15, Troubleshooting and Recovery.
The utility can be used against SQL Server versions 4.21a or
later. ODBCPING can be used from Windows NT and Windows 95
clients. If the /D switch is used, the utility can be used
against any ODBC data source for the Win32 version(s) of the
Microsoft SQL Server Driver (SQLSRV32.DLL). If /D is
specified for a data source using a Win32 non-SQL Server
driver, ODBCPING will connect through the data source, but
may encounter difficulties when it attempts to find the SQL
Server version string. The utility does not work with Win16
ODBC drivers.
The following example demonstrates how to use this utility
and how to verify the information it provides.
If you execute the following from the command line (abc is
the server name):
c:\mssql\binn>odbcping -Sabc -Usa -Pxyz
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
c:\mssql\binn>odbcping -Dsdk21-Access32 -Usa -Pxyz
CONNECTED TO SQL SERVER
ODBC SQL Server Driver Version: 3.40.2505
SQL Server Version: |^w
Q137635 : INF: ODBC SQL Server Connection Parameters
Q137634 : INF: ODBC SQL Server Network Messages
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.
Additional query words: sql6 2.50 odbc windows nt err code
Keywords : kbinterop kbtool SSrvGen
Version : 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: April 13, 1999