The information in this article applies to:
SUMMARYWhen a Windows DLL is written such that it acts as an intermediary between several applications and ODBC drivers, it may be necessary to share connections among the applications. This article discusses the architectural blocks to sharing ODBC environment, connection, and statement handles among several applications through a user Windows DLL. It also discusses how a service provider DLL can be written so that it can access ODBC drivers and provide an interface to applications without sharing handles between applications. MORE INFORMATION
ODBC Environment, connection, and statement handles are unique to tasks and
cannot be shared among different tasks because the ODBC Driver Manager and
ODBC drivers, when allocating memory for the connection, do not use the
DDE_SHARE option on the GlobalAlloc(). For instance, in response to a call
from an application, when a user DLL calls SQLAllocConnect() in the driver
DLL, the memory is being allocated by the driver DLL in the context of the
calling task, for example, the task that called the user DLL. In this
scenario, another task that calls this same user DLL cannot then use this
recently allocated connection handle to call ODBC functions.
Additional query words:
Keywords : |
Last Reviewed: August 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |