As you know, @@TRANCOUNT is used to inform you about the number of live transactions active at point. If you want to retrieve it's value using an application, you should be careful about the behaviour of the returned value. Let us consider the procedurecreate procedure get_count
as
select @@TRANCOUNT as trancountConsider the VB code that calls the procedurePrivate Sub Form_Load()
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
con.Open "connection string"
con.BeginTrans
Set rs = con.Execute("exec get_count")
MsgBox rs("trancount")
con.CommitTrans
End SubRead more: Beyond Relational
as
select @@TRANCOUNT as trancountConsider the VB code that calls the procedurePrivate Sub Form_Load()
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
con.Open "connection string"
con.BeginTrans
Set rs = con.Execute("exec get_count")
MsgBox rs("trancount")
con.CommitTrans
End SubRead more: Beyond Relational
0 comments:
Post a Comment