Vb.net ADODB连接状态属性
我正在做我公司的一个老项目,是用VB.NET编写的(整个应用程序中没有try-catch块*)。基本的问题是它将僵尸进程抛在了后面 我怀疑的是它正在使用的DB调用,即ADODB连接对象来查询sql数据库Vb.net ADODB连接状态属性,vb.net,adodb,Vb.net,Adodb,我正在做我公司的一个老项目,是用VB.NET编写的(整个应用程序中没有try-catch块*)。基本的问题是它将僵尸进程抛在了后面 我怀疑的是它正在使用的DB调用,即ADODB连接对象来查询sql数据库 adoConn.Open("DSN=NameOfDatabase;UID=NameOfSA;PWD=password") 我的想法是引入一个简单的DB状态检查。使用 adoConn.State(int) 但我不确定adoConn.State的可能值是什么。 我查过了,但没有这方面的信息 我很
adoConn.Open("DSN=NameOfDatabase;UID=NameOfSA;PWD=password")
我的想法是引入一个简单的DB状态检查。使用
adoConn.State
(int)
但我不确定adoConn.State的可能值是什么。
我查过了,但没有这方面的信息
我很精通C#所以我觉得
0:关闭
1:连接
2:连接等
任何这样的信息(加上适当的引用)都会非常有用
状态
属性(ADO)指示所有适用对象的状态是打开还是关闭。如果对象正在执行异步方法,则指示对象的当前状态是正在连接、执行还是正在检索
返回可以是
ObjectStateEnum
值的长值。默认值为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.
State
属性(ADO)指示所有适用对象的状态是打开还是关闭。如果对象正在执行异步方法,则指示对象的当前状态是正在连接、执行还是正在检索
返回可以是
ObjectStateEnum
值的长值。默认值为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.
Intelissense应该给你这个。。。。adoConn.State=ADODB.objectstatenum.adStateOpen etcThanks@Fred,我是C#dev,Intelissense在这方面更强大,它也提供RHS的选项。沉迷于智慧。无论如何谢谢:)英特利森应该给你这个。。。。adoConn.State=ADODB.objectstatenum.adStateOpen etcThanks@Fred,我是C#dev,Intelissense在这方面更强大,它也提供RHS的选项。沉迷于智慧。无论如何,谢谢:)我认为返回类型是Int,在对象浏览器中查看后,它生成了:Public Enum objectstatenum作为ADODB的Integer成员
objectstatenum
值是一个Integer
。我的意思是State
属性返回的Long
可以是objectstatenum
值,它是Integer
我认为返回类型是Int,在对象浏览器中查看后,它生成了:作为ADODB的整数成员的公共枚举ObjectStateEnumObjectStateEnum
值是一个Integer
。我的意思是State
属性返回一个Long
,它可以是objectstatenum
值,它是Integer