PRB: IM003 Specified Driver Could Not Be Loaded

ID: Q119904

The information in this article applies to:

SYMPTOMS

When you are trying to use the DBConnect() function to connect to a data source with the FoxPro Connectivity Kit (CK), the following error message occurs:

   ODBC error IM003(0): [Microsoft][ODBC DLL] Specified driver
   could not be loaded

CAUSE

The required driver .DLL is missing from the WINDOWS\SYSTEM subdirectory.

RESOLUTION

Reinstall the driver from disk.

MORE INFORMATION

The error listed above can be reproduced using the SQL Server driver. FoxPro communicates to SQL Server by going through the following basic ODBC levels:

   FoxPro
   |
   FPSQL.FLL
   |
   ODBC Driver Manager
   (ODBC.DLL)
   |
   ODBC Cursor Library (Optional)
   (ODBCCURS.DLL)
   |
   SQL Server Driver (16-bit)
   (SQLSRVR.DLL)
   |
   Network Library
   (DBNMP3.DLL, DBMSSPX3.DLL, and so on)
   |
   Network Software
   (Microsoft LAN Manager, Novell NetWare, and so on)
   |
   SQL Server DBMS

SQLSRVR.DLL is the driver in this instance. The SQLSRVR.DLL file is located in the WINDOWS\SYSTEM subdirectory. If the SQLSRVR.DLL file is missing, the error message will appear.

The driver's filename can be found by looking in the ODBC.INI file located in the WINDOWS directory. Below is an excerpt from the ODBC.INI file:

   [test]
   Driver=C:\WINDOWS\SYSTEM\sqlsrvr.dll
   Description=
   Server=REDDFOXX

In the example above, "test" is the data source name as it appears in the ODBC Driver Manager. The "driver=" line gives the path and name of the driver that is associated with the data source "test".

Steps to Reproduce Problem

1. Configure an SQL Server driver with the following information

      Data Source Name: test
      Server: REDDFOXX

   where REDDFOXX is the actual name of the SQL Server.

2. Rename SQLSRVR.DLL to SQLSRVR.BAK. (The SQLSRVR.DLL file is located in
   the C:\WINDOWS\SYSTEM subdirectory.)

3. Run the following code:

      * This code assumes that the driver is configured correctly
      * in step 1 and that FPSQL.FLL is in the FoxPro directory.
      SET LIBRARY TO SYS(2004)+"fpsql.fll"
      h=DBConnect("test","sa","")
      errmsg=""
      errval=0
      ?DBError(0,@errmsg,@errval)
      ?errmsg

Note that the error message appears.

Additional reference words: FoxWin 2.50a 2.50b 2.50c 2.60 errmsg novel KBCategory: kbenv kbprb kberrmsg KBSubcategory: FxtoolCk

Last Reviewed: June 27, 1995