I am working on an old project of my company, written in VB.NET (with no try catch block in whole app * sigh *). The basic problem is it leaves zombie process behind.
What I am suspecting is the DB call it is using i.e. ADODB connection object to query sql database.
adoConn.Open("DSN=NameOfDatabase;UID=NameOfSA;PWD=password")
What I am thinking is to introduce a simple check for DB state. using
adoConn.State (int)
but I am not sure what are the possible values for adoConn.State. I have checked on https://msdn.microsoft.com/en-us/library/adodb._connection.state%28v=vs.90%29.aspx but no information as such.
I am well versed with C# so i though it would be like
0: closed
1: Connecting
2: Connected etc.
Any such information (with proper citation) would be really helpful.
State Property (ADO) indicates for all applicable objects whether the state of the object is open or closed. If the object is executing an asynchronous method, indicates whether the current state of the object is connecting, executing, or retrieving.
Returns a Long value that can be an ObjectStateEnum value. The default value is adStateClosed.
Constant Value Description
adStateClosed 0 Indicates that the object is closed.
adStateOpen 1 Indicates that the object is open.
adStateConnecting 2 Indicates that the object is connecting.
adStateExecuting 4 Indicates that the object is executing a command.
adStateFetching 8 Indicates that the rows of the object are being retrieved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With