Microsoft KB Archive/151598

= How to Use ESQL in a Threaded Application =

Article ID: 151598

Article Last Modified on 6/10/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft Embedded SQL for C Programmer's Toolkit 4.22

-



This article was previously published under Q151598



SUMMARY
This article describes how you use ESQL in a threaded application.



MORE INFORMATION
Embedded SQL Server for C is not thread-safe. If you use ESQL in a threaded application, you must only use ESQL calls from a single thread of execution, and it is best if you use the main thread.

If you put the ESQL calls in a thread other than the main thread, the thread can only be started one time. The thread must then remain available for all subsequent ESQL needs. To clarify, if you put the ESQL calls in a thread, and you then start and stop that thread multiple times to perform database tasks, you may experience unexpected behavior.

To implement a thread that handles all ESQL activity, you must set up the thread with an event-triggering mechanism.

This applies to Embedded SQL versions 4.22, 6.5 and 2000.

Keywords: kbinfo kbprogramming KB151598

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.