Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Disconnecting from a Data Source

SQL Server 2000

When an application has finished using a data source, it calls SQLDisconnect. SQLDisconnect frees any statements that are allocated on the connection and disconnects the driver from the data source. After disconnecting, the application can call SQLFreeHandle to free the connection handle. Before exiting, an application also calls SQLFreeHandle to free the environment handle.

After disconnecting, an application can reuse the allocated connection handle, either to connect to a different data source, or to reconnect to the same data source. The decision to remain connected, as opposed to disconnecting and reconnecting later, requires that the application writer consider the relative costs of each option: both connecting to a data source and remaining connected can be relatively costly, depending on the connection medium. In making a correct tradeoff, the application must also make assumptions about the likelihood and timing of further operations on the same data source. An application may also need to use more than one connection.

To use connections


See Also


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.