Kbase 21232: How To Disable OLEDB Connection Pooling from VB Code
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  28/10/2008 |
|
SUMMARY:
This Knowledge Base shows how to disable OLEDB connection pooling from Visual Basic (VB) applications.
EXPLANATION:
When OLEDB connection pooling is enabled by default from VB applications, SQLDisconnect is not called immediately after clients disconnect, and the _sqlsrv2 process is not released. In extreme cases, the client can run out of connections.
This behavior can be changed via code.
SOLUTION:
Original code:
Private Sub ConnectProgress()
'm_strConnectionString = "driver={MERANT 3.60 32-BIT PROGRESS SQL-92
v9.1B};uid=sysprogress;pwd=default;db=vk4xclin;HOST=192.168.113.223;PORT=150
00"
m_strConnectionString = "driver={MERANT 3.60 32-BIT PROGRESS SQL-92
v9.1C}" & _
";uid=" & Trim(txtProgUID) & _
";pwd=" & Trim(txtProgPWD.Text) & _
";db=vk4xclin;HOST=" & Trim(txtHost.Text) & _
";PORT=" & Trim(txtPort.Text)
Modified code:
Private Sub ConnectProgress()
'm_strConnectionString = "driver={MERANT 3.60 32-BIT PROGRESS SQL-92
v9.1B};uid=sysprogress;pwd=default;db=vk4xclin;HOST=192.168.113.223;PORT=150
00"
m_strConnectionString = "driver={MERANT 3.60 32-BIT PROGRESS SQL-92
v9.1C}" & _
";uid=" & Trim(txtProgUID) & _
";pwd=" & Trim(txtProgPWD.Text) & _
";db=vk4xclin;HOST=" & Trim(txtHost.Text) & _
";PORT=" & Trim(txtPort.Text) & _
"; OLE DB Services = -2"