How To Enable ODBC Connection Pooling in a Visual Basic ADO Application:
How To Enable ODBC Connection Pooling in a Visual Basic ADO Application
This article was previously published under Q237844
SUMMARY
By default, ADO uses OLEDB session pooling to maintain a pool of connections to the database. In some cases, you might want to use ODBC connection pooling instead of OLEDB session pooling. This article describes what is necessary to enable ODBC connection pooling from a Visual Basic/ADO application.
Note The following only applies if you are using an ODBC driver to establish the connection to your database.
MORE INFORMATION
To enable ODBC connection pooling from a Visual Basic/ADO application, there are two necessary steps: Note The following only applies if you are using an ODBC driver to establish the connection to your database.
MORE INFORMATION
1. | Open the ODBC Data Source Administrator from the control panel. Select the Connection Pooling tab. Find the driver that you are using in the list and double-click on it. Choose the option Pool connections to this driver and enter a timeout value. Note This only applies to the ODBC Administrator version 3.5 or later. If you are using an earlier version of the Administrator, then you need to find the CPTimeout value for your driver in the registry under the following registry key and set the value: HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST.INI/Driver_Name For more information on setting this value in the registry, please see the following document: http://msdn.microsoft.com/library/techart/pooling2.htm (http://msdn.microsoft.com/library/techart/pooling2.htm) The second step is to add an ODBC API function call to SQLSetEnvAttr in your application with the appropriate options to enable ODBC connection pooling for the process. This function should only be called once per process and must be called prior to executing any ADO code. Below are the steps necessary to create a complete Visual Basic code sample demonstrating this:
|
0 Comments:
Post a Comment
<< Home