Thursday, July 16, 2009

Tip #49 – Retrieving Database Objects

You can get a list of tables on a data dictionary connection using the GetTableNames ( see Tip #47 ) method. However, if you want to get a list of views, users or stored procedures you need to use the GetDDObjects method. This method can return any of the database objects as defined in the AdsObjectType enumeration.

The screenshot below shows all of the main object types in a tree view control.

Dictionary Objects

The function takes two arguments the AdsObjectType and the Parent Name. The parent name is only required when getting a list of sub-objects, for lack of a better term. These include the Index File, Index and Field object types. These objects are all associated with a table object. When the table object is expanded in the sample application these new object types are shown as sub items.

Dictionary Table Objects

Note: Currently Groups, Functions, Publications and Subscription objects cannot be retrieved using the GetDDObjects method.

No comments: