INF: Running ODBC Applications as Windows NT Services

Last reviewed: October 14, 1997
Article ID: Q136481
2.50 WINDOWS kbenv kberrmsg kbfile kberrmsg

The information in this article applies to:

  • Microsoft Open Database Connectivity, version 2.5

SUMMARY

ODBC applications running as Windows NT services may encounter the following error when attempting to connect to an ODBC data source:

   szSqlState = "IM002"
   pfNativeError = 0
   szErrorMsg = "[Microsoft][ODBC Driver Manager] Data source name
                 not found and no default driver specified"

MORE INFORMATION

When a standard ODBC data source is defined, it is specific to the Windows NT account under which the ODBC Administrator process is running. This is because the data source definition is stored in the HKEY_CURRENT_USER hive in the Windows NT registry. Applications running in environments which do not have that specific user's hive set up as HKEY_CURRENT_USER will not have access to that data source.

Applications running as Windows NT services can be made to run under a Windows NT account using the control panel, but may be running at times when that user's hive is not the one set up as HKEY_CURRENT_USER. For example, if the NT account is not logged on, their hive will not be set as HKEY_CURRENT_USER, and the NT service will not be able to access the ODBC data source. This also applies to DLLs running as SQL Server version 6.0 Extended Stored Procedures because they run as part of the SQL Server process, which always runs as a Windows NT service. This same problem also affects applications running under the Windows NT Scheduler service, which covers applications started with the Windows NT AT command.

Microsoft ODBC version 2.5 addresses this problem by introducing the concept of a system data source. The definitions of system data sources are stored in the registry HKEY_LOCAL_MACHINE hive under SOFTWARE/ODBC/ODBC.INI where they will always be accessible to Windows NT services.

ODBC 2.5 started shipping with Microsoft SQL Server version 6.0 and Microosft Office 95, and will ship with future releases of other ODBC- capable products.

Users who do not already have an ODBC 2.5 driver installed can obtain the ODBC 2.5 ODBC Administrator and Driver Manager by downloading the file ODBC25.EXE from the Microsoft Software Library (MSL).

You can find ODBC25.EXE (size: 456616 bytes) 
                       , a self-extracting file, on the following services:

  • Microsoft's World Wide Web Site on the Internet

          On the www.microsoft.com home page, click the Support icon.
          Click Knowledge Base, and select ODBC.
    
          Enter kbfile ODBC25.EXE (size: 456616 bytes) 
                                 , and click GO!
          Open the article, and click the button to download the file.
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com.
          Change to the Softlib/Mslfiles folder.
          Get ODBC25.EXE. (size: 456616 bytes) 
    
  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location.
          Type "mssupport" (without the quotation marks).
          Double-click the MS Software Library icon.
          Find the ODBC product area.
          Locate and download ODBC25.EXE.
    
  • Microsoft Download Service (MSDL)

          Dial (425) 936-6735 to connect to MSDL.
          Download ODBC25.EXE. (size: 456616 bytes) 
    

    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online
                   Services
    
    
    The file ODBC25.EXE also includes documentation on the new features in ODBC 2.5, such as the system data sources.


  • Additional reference words: 2.50 drivers msnSQL
    KBCategory: kbenv kbfile kberrmsg
    KBSubcategory: odbc
    Keywords : odbc kbenv kberrmsg kbfile
    Version : 2.50
    Platform : WINDOWS


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: October 14, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.