Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: VisualBasic, Created At: 10/24/2016 7:57:47 PMViews:

HTML view:
Copy Source | Copy HTML
  1. Dim objFSO
  2. Dim objFile
  3. Dim LogFileName
  4. Dim Result
  5. Sub CloseConnection()
  6. Dim Connector, Agent, Cluster, WorkProcess, WorkProcessConnection, Base, Connections, i, CurrentConnection
  7. Dim BaseList
  8. 'Идентификаторы баз в кластере серверов 
  9. BaseName = "Base8"
  10. Set Connector = CreateObject("V82.COMConnector")
  11. 'Селект текущего кластера серверов 
  12. Set Agent = Connector.ConnectAgent("MyServer")
  13. Set Cluster = Agent.GetClusters()(0)
  14. Agent.Authenticate Cluster, "Admin", "pass1"
  15. MassBase = Agent.GetInfoBases(Cluster)
  16. For i = LBound(MassBase) To UBound(MassBase)
  17. Set Base = MassBase(i)
  18. 'MsgBox Base.Name 
  19. If Base.Name = "Base1CV8" Then
  20. Sessions = Agent.GetInfoBaseSessions(Cluster, Base)
  21. For k = LBound(Sessions) To UBound(Sessions)
  22. Set ThisSession = Sessions(k)
  23. If ThisSession.AppID <> "COMConsole" Then
  24. Agent.TerminateSession Cluster, ThisSession
  25. 'MsgBox "User: " & ThisSession.UserName & " App ID: " + ThisSession.AppID 
  26. End If
  27. Next
  28. Exit For
  29. End If
  30. Next
  31. End Sub

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017