Submit a ticketCall us

AnnouncementsAre You “Flying Blind?”

When it comes to your complex IT infrastructure, you want to ensure you have a good grasp of what’s going on to avoid any fire drills that result from guesswork. Read our white paper to learn how proactively monitoring your IT environment can help your organization while giving you peace of mind.

Get your free white paper.

Home > Success Center > Kiwi CatTools > Kiwi CatTools Documentation > Kiwi CatTools 3.11 Administrator Guide > API > CatTools API Classes > Groups > Sample code to list Groups found in your database

Sample code to list Groups found in your database

Table of contents
No headers
Created by Caroline Juszczak, last modified by Caroline Juszczak on Jun 28, 2016

Views: 135 Votes: 0 Revisions: 1

Sample VB code showing you how to list the Groups found in your database using the CatTools API.

 

Dim DB As CatToolsAPI.Database

Dim Groups As CatToolsAPI.Groups

Dim Group As CatToolsAPI.Group

 

Set DB = New CatToolsAPI.Database

 

DB.OpenConnection

If DB.Connected Then

Set Groups = DB.Groups

If Not Groups Is Nothing Then

Debug.Print Groups.Count & " groups in the database"

For Each Group In Groups

Debug.Print "->" & Group.Name

DoEvents

Next

Else

Msgbox "Error:" & DB.ErrDescription

End If

Else

Msgbox "Connection failed: " & DB.ErrDescription

End If

 

DB.CloseConnection

 

Set Group = Nothing

Set Groups = Nothing

Set DB = Nothing

Last modified

Tags

Classifications

Public