Database Reference
In-Depth Information
nSelectClick
). The code defaults the name of the server to “localhost”. The user
can change it before clicking the Connect button. Once the button is clicked, the code
calls
btnConnectClick
.
The
btnConnectClick
subroutine creates objects for the Server, Integration
Services, and Catalog objects in the model. Next, it builds a hierarchy of four levels of
nodes starting with the catalog. The variables—
L1Node
,
L2Node
,
L3Node
, and
L4Node
— represent the Catalog, Folder, Project, and Package levels of the hierarchy.
The code uses a series of nested For Each loops to iterate the SSIS Catalog and popu-
late the subnodes under
L1Node
(Catalog), and then the
L1Node
is added to the
tvCatalog
treeview.
The
btnSelectClick
subroutine builds a string the represents the unique path
to the SSIS package in the catalog hierarchy. The code checks to see if a node is selec-
ted and then checks to see if the selected node is at the package level. If all is right with
the treeview, the variable
sFullSSISPkgPath
is populated with the path to the
SSIS package in the catalog. Immediately thereafter, the frmISTree form closes. Users
can also double-click on a package node in the treeview and invoke the
bt-
nSelectClick
subroutine.
Execute the application to test it! You should see results as in
Figure 2-12
.
Figure 2-12
.
Executing a package from the file system
Selection of a package in the SSIS Catalog appears as shown in
Figure 2-13
.
Search WWH ::
Custom Search