PRB: File DSN and DSN-Less Connections May Fail w/Localized ODBCLast reviewed: October 22, 1997Article ID: Q174655 |
The information in this article applies to:
SYMPTOMSWhen shareable file Data Source Name (DSN) or DSN-less connections are used on computers with localized Open Database Connectivity (ODBC) driver descriptions, the connection may fail with the following message:
IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified CAUSEShareable file DSN and DSN-less connections use the DRIVER keyword to indicate which ODBC driver to use. The DRIVER keyword is set to a driver description that must match the description of an installed driver on the client computer. On computers with localized ODBC driver descriptions, the description used in the file DSN or DSN-less connection may not match that of the installed driver, thereby causing the error message described above. For example, if the German version of Microsoft Office 97 installed the ODBC Access 97 driver with a description of "Microsoft Access-Treiber (*.mdb)," a file DSN or a DSN-less connection containing "DRIVER={Microsoft Access Driver (*.mdb)}" will fail, even though the Access driver has been installed properly.
WORKAROUNDTo work around this problem, do either of the following:
#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 (); } |
Additional query words: jet desktop database
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |