The information in this article applies to:
SUMMARYIf an application makes a SQLConnect or SQLDriverConnect call to ODBC Desktop Drivers 3.x, and if the application is idling after SQLConnect or SQLDriverConnect has returned, any other application that broadcasts a DDE message (message broadcasters) may hang. Once the application disconnects from the database, the hanging application works normally. MORE INFORMATION
When SQLConnect or SQLDriverConnect is called, ODBC DeskTop Drivers
initialize OLE using threads that they create internally. As a result of
OLE initialization, three hidden windows--DDEServerWindow, OLEChannelWnd,
and OLEMainthreadwndname--are created.
Q136885 OLE Threads Must Dispatch MessagesTo prevent the DDE app from continuing to hang after SQLConnect or SQLDriverConnect has returned, all threads that call SQLConnect or SQLDriverConnect need to handle the DDE messages sent by the DDE app. The following example gives an overview of how to accomplish this: NOTE: With the ODBC Desktop Database Drivers 2.0 running on Windows NT 3.5,
only one thread can make a SQLConnect or SQLDriverConnect call. Other
threads in the same application cannot make the connection calls at any
time while the application is running. Once a connection is made on a
thread, the connection (hdbc) can be shared by other threads. This is
because OLE did not support multithreading in Windows NT 3.5.
In Windows NT 3.51, the above does not apply as OLE supports multithreading. However, you need to ensure that the first thread that calls SQLConnect or SQLDriverConnect is the last thread to call SQLDisconnect. Additional query words:
Keywords : |
Last Reviewed: January 3, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |