Working with the Metadata Container (VCL, ActiveX and Java)
This article is related to Java, ActiveX, and VCL editions.
The relevant article for Active Query Builder .NET Editon can be found here:
Metadata Container (QueryBuilder.MetadataContainer) is a collection of database objects displayed in the metadata tree. Each object contains collections of Fields and Relations (foreign keys). You can easily add or remove objects from this collection to show or hide objects from the Database Schema Tree. Some database objects can be hidden, i.e. they are loaded in the metadata container, but not visible in the tree. System objects are hidden by default.
Metadata container is normally filled with RefreshMetadata or LoadMetadataByMask, LoadMetadataByFilter methods. These methods fill the list of database objects and their relations, but not their fields as it may take a long time to do that in the case of large databases or slow connections. Fields are usually loaded when an object is added to the query building area. To load fields during the RefreshMetadata method call you should set the WorkOffline (OfflineMode) property to True.
The WorkOffline (OfflineMode) property instructs the component to work in offline mode, i.e. it denies any hidden SQL query executions (mostly to load fields of some database objects). But in the case of direct calls to the metadata loading methods, it instructs the component to load metadata information completely, i.e. with fields of each loaded database object.
If you already have the list of allowed objects, you don't need to call the RefreshMetadata method. Instead, you can fill the Metadata Container programmatically:
For Each AllowedTableName As String In AllowedTables QueryBuilder.MetadataContainer.AddTable("", AllowedTableName, False, "") Next
The first parameter of the AddTable method is a schema name; the third parameter is a flag for system objects, the fourth is a database name.