You are currently offline, waiting for your internet to reconnect

PRB: File DSN and DSN-Less Connections May Fail with Localized ODBC

This article was previously published under Q174655
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
When shareable file Data Source Name (DSN) or DSN-less connections are usedon computers with localized Open Database Connectivity (ODBC) driverdescriptions, the connection may fail with the following message:
IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Shareable file DSN and DSN-less connections use the DRIVER keyword toindicate which ODBC driver to use. The DRIVER keyword is set to a driverdescription that must match the description of an installed driver on theclient computer. On computers with localized ODBC driver descriptions, thedescription used in the file DSN or DSN-less connection may not match thatof the installed driver, thereby causing the error message described above.

For example, if the German version of Microsoft Office 97 installed theODBC Access 97 driver with a description of "Microsoft Access-Treiber(*.mdb)," a file DSN or a DSN-less connection containing "DRIVER={MicrosoftAccess Driver (*.mdb)}" will fail, even though the Access driver has beeninstalled properly.
To work around this problem, do either of the following:

  • Change the driver description used in the file DSN or DSN-less connection so that it matches the one on the client computer.

  • Install the driver again on the client computer with the description used in the connect string. Note that using this option will result in more than one description for the same driver, which will allow any program using any one of the localized descriptions to connect through the driver on the client.
The following ODBC 3.0 sample code illustrates a minimal installation ofthe ODBC SQL Server driver with an English driver description. You canalter the code to install any ODBC driver with any driver description. Formore information concerning the files and function calls used in the code,see the ODBC 3.0 SDK.
   #include <windows.h>   #include <stdio.h>   #include <odbcinst.h>   void ShowErrors ()   {      WORD     iError = 1;      DWORD pfErrorCode;      char     lpszErrorMsg[301];      WORD     cbErrorMsgMax = 300;      RETCODE  rc;      while (SQL_NO_DATA != (rc = SQLInstallerError(               iError ++,               & pfErrorCode,               lpszErrorMsg,               cbErrorMsgMax,               NULL )))         if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)            printf( "%s\n", lpszErrorMsg);      printf ("\n");   }   void main ()   {      char *    szDriver = "SQL   Server\0Driver=sqlsrv32.dll\0Setup=sqlsrv32.dll\0\0";      char *    szPathIn = "c:\\winnt\\system32";      char   szPathOut[301];      WORD   cbPathOutMax = 300;      WORD   cbPathOut;      DWORD dwUsageCount;      printf ("Calling SQLInstallDriverEx ...\n");      if (!SQLInstallDriverEx(            szDriver,            szPathIn,            szPathOut,            cbPathOutMax,            & cbPathOut,            ODBC_INSTALL_COMPLETE,            & dwUsageCount))         ShowErrors ();      printf ("Calling SQLConfigDriver ...\n");      if (!SQLConfigDriver(            NULL,            ODBC_INSTALL_DRIVER,            "Microsoft Access - test 4",            "",            szPathOut,            cbPathOutMax,            & cbPathOut))         ShowErrors ();   }				
jet desktop database

Article ID: 174655 - Last Review: 08/25/1999 11:16:00 - Revision: 1.0

Microsoft Open Database Connectivity 3.0

  • kbcode kbprb KB174655