IBM Computer, Laptops and Servers

Back Homepage Content Directory Resource Guide Blog

INF: ODBCPING.EXE to Verify ODBC Connectivity to SQL Server (Q138541)

The information in this article applies to:

Microsoft SQL Server versions 6.0 , 6.5 , 7.0 Microsoft SQL Server 2000 (all editions)

SUMMARY

Laptop Battery Microsoft SQL Server versions 6.0 and later 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.
MORE INFORMATION

  • Centerline is capable of providing KVM and consol connectivity to up to 42 devices in a single rack.
  • Centerline is agnostic to device type and OS.
  • Each Centerline appliance reports back to a single server containing management policies and an SQL database. monitoring power draw for the rack as a whole and individual ports, remote power off and power on of individual ports, setting power thresholds with alerts and automatic responses and staggered start up, any changes or events relating to power supply are logged in the SQL database on the management server.

Thinkpad 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
ODBCPING will return the following information on a successful connection:
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
The utility gives you SQL Server and driver version number information.

ODBCPING was written with the assumption it would be used to test SQL Server driver data sources. If the /D switch is used to connect to a non-SQL Server driver ODBC data source, ODBCPING will print out the ODBC driver version, but will not print correct server information. If errors are encountered on the connect attempt, ODBCPING will correctly report the errors encountered. For example, issuing the following on a client that has the ODBC SDK sample applications installed:
c:\mssql\binn>odbcping -Dsdk21-Access32 -Usa -Pxyz
if a successful connect, results in the following output:
CONNECTED TO SQL SERVER
ODBC SQL Server Driver Version: 3.40.2505
SQL Server Version: |^w
When the /S switch is specified, ODBCPING, will use the default network library specified in the SQL Client Configuration Utility. When the /D switch is specified, ODBCPING will use the network library defined in the data source. Users wanting to quickly test the basic setup of multiple network libraries can use the SQL Client Configuration Utility to set different network libraries as the default protocol, and test them using ODBCPING with the /S switch.

For additional information regarding ODBC SQL Server Connection Parameters, please see the following article in the Microsoft Knowledge Base:
: INF: ODBC SQL Server Connection Parameters
The utility serves as an alternative to the ODBC Test utility in the ODBC SDK package. It helps in loading different network libraries and testing the connectivity through ODBC. It also helps in verifying that the ODBC modules are installed and configured correctly. The limitation, however, is that it cannot be run in a Win16 (for example, Windows 3.1 or Windows for Workgroups) client environment.

There is a limitation in using the 6.0 version of the ODBCPING utility to interpret connectivity errors. For example, if the ODBCPING utility is used to try to connect to a server which does not exist in the network, then the pfNative error does not get displayed, so you cannot interpret the actual source of the problem.

For more information on interpreting pfNative code reported by connectivity errors, please see the following article in the Microsoft Knowledge Base:
: INF: ODBC SQL Server Network Messages
The scenario can be illustrated by the following example:

Using the 6.0 ODBCPING utility on an unsuccessful connection with named pipes reports the following error:
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.
While the same error in the 6.5 ODBCPING returns the following information:
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.

Computer memory is the quickest, cheapest, and easiest way to improve the performance of your system. Find RAM memory upgrades for desktops, laptops, servers, and printers all backed by a lifetime warranty and guaranteed compatible with your computer. Shipping is an everyday low price of $1.99! Computer Memory Outlet sells memory compatible with all leading computer manufacturers like Dell, Apple, Compaq, HP, Sony, IBM, Lenovo, and many more.”

Published Apr 19 1996 12:00AM Issue Type Last Modifed Oct 27 2000 8:36PM Additional Query Words sql6 2.50 odbc windows nt err code Keywords kbinterop kbtool kbDSupport kbSQLServ2000

Share this:

Add To Yahoo MyWeb Add To Google Bookmarks Add To Furl Fav This With Technorati Add To Newsvine Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This Digg This Add To Del.icio.us Add To Reddit

More about:

Jun July 2008 Aug
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

IBM Computer, Laptops and Servers Blog on Technorati Related Blog of IBM Computer, Laptops and Servers on Sphere
Content Directory
Resource Guide


LaptopShop Cheap Laptops New n Refurbished Laptops

Website Links
IBM Computer, Laptops and Servers Copyright © 2008 www.ibmfans.com. All rights reserved. Site Map
Homepage | Blog | Advertise | Privacy Policy | Disclaimer | Contact Us | Links