TEG
Jun 2nd, 1999, 08:17 PM
Ok, I would like your opinions; after many hours testing; I can't figure out how the connection object works... Nor what the most efficient way of using one is...
When I create a connection object in code and then set it to a recordset object and a command object (for a stored procedure using SQL Server 7.0; VB6) then disconnect the recordset by setting its activeconnection property to Nothing and same for the command object; close the connection; SQL Server performance monitor is not showing the connection to be closed. WHY????
On top of this, when I run the same routine again; then I have two connections open! After a certain period of time the connection apparently times out and does actually close. Is this a bug??? Or am I doing something incorrectly? Has anyone else seen this?
Also, what is the best way to use connection object; create and destroy each time or just open one connection object at form load and destroy it at form unload; what are the pros and cons of each way... Seems to me that by creating the connection at form load and destroying at form unload, may put a little more overhead on each client; but reduces the server traffic by not having to recreate this connection every time... But, I don't know; will this cause problems with multiple users when everyone always has one connection open???
Boy, this was a book wasn't it? Thanks for reading, and for the help...
When I create a connection object in code and then set it to a recordset object and a command object (for a stored procedure using SQL Server 7.0; VB6) then disconnect the recordset by setting its activeconnection property to Nothing and same for the command object; close the connection; SQL Server performance monitor is not showing the connection to be closed. WHY????
On top of this, when I run the same routine again; then I have two connections open! After a certain period of time the connection apparently times out and does actually close. Is this a bug??? Or am I doing something incorrectly? Has anyone else seen this?
Also, what is the best way to use connection object; create and destroy each time or just open one connection object at form load and destroy it at form unload; what are the pros and cons of each way... Seems to me that by creating the connection at form load and destroying at form unload, may put a little more overhead on each client; but reduces the server traffic by not having to recreate this connection every time... But, I don't know; will this cause problems with multiple users when everyone always has one connection open???
Boy, this was a book wasn't it? Thanks for reading, and for the help...