FIX: SQLManageDataSources Fails When Connection Pooling Is Turned On at Process Level (312495)
The information in this article applies to:
- Microsoft Data Access Components 2.7
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.6 SP1
- Microsoft Data Access Components 2.6 SP2
This article was previously published under Q312495 SYMPTOMS
When you turn on connection pooling at the process level and call the SQLManageDataSources function to configure a file data source name (DSN), you may receive the following error:
General error: Invalid file dsn 'C:\Program Files\Common Files\ODBC\Data Sources\XXX.dsn'
CAUSE
When used to configure a file DSN, SQLManageDataSources internally creates a connection handle (SQLHDBC handle) and calls the SQLDriverConnect function with the SQL_DRIVER_PROMPT option. The SQL_DRIVER_PROMPT option is not supported with SQLDriverConnect when connection pooling is turned on.
RESOLUTIONMDAC 2.7A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next MDAC service pack that contains this hotfix. To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site: NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this fix should have the following file attributes or later:
Date Version Size File name Platform
-----------------------------------------------------------
20-Nov-2001 3.520.8120.0 200,704 Odbc32.dll x86
WORKAROUND
To work around this problem, either turn off connection pooling or turn on connection pooling using an environment handle (SQLHENV). Do not turn on connection pooling at the process level.
For example, the following code works properly:
SQLHENV hEnv;
SQLAllocHandle(SQL_HANDLE_ENV, NULL, &hEnv);
SQLSetEnvAttr(hEnv,SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_NTS);
Note that an environment handle is passed as the first argument rather than SQL_NULL_HENV. A value of SQL_NULL_HENV for the first argument turns on connection pooling process-wide.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 10/12/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbBug kbprb kbQFE KB312495 |
---|
|