DataModelSection (Object)

Member of:

QuerySection object

Description:

Represents the underlying Data Model for a Query Section or DataModelSection object. The Data Model (Object) contains connection information, Table Catalog, etc. you access from the Data Model or Query section.

Example 1:

This example shows how to define basic properties of a Data Model. It disables AutoJoin and AutoAlias, limits queries to 20 minutes, and enables joins between iconized topics. Use the with statement to call object methods and properties without qualifying them:

with (ActiveDocument.Sections["Query"].DataModel)
{
   AutoAlias = false
   AutoJoin = false
   TimeLimit = 20
   ShowIconJoins = true
}

Example 2:

This example shows how to build a Data Model using the Table Catalog object. It assumes a database connection.

with (ActiveDocument.Sections["Query"].DataModel)
{
Topics.RemoveAll()
AutoJoin = false
//Create two new topics from tables in Table Catalog
Catalog.Refresh()
Table1 =Catalog.CatalogItems["WINE"]
Table2 =Catalog.CatalogItems["WINE_SALES"]
Topics.Add(Table1)
Topics.Add(Table2)
Field1 = Topics[1].TopicItems["Wine Id"]
Field2 = Topics[2].TopicItems["Wine Id"]
//Create a new join by joining two TopicItems together
Joins.Add(Field1,Field2,bqJoinSimpleEqual)
// Now add topic items to the request line
for (I = 1; I <= Topics[1].TopicItems.Count; I++)
ActiveDocument.Sections["Query"].Requests.Add(Topics[1].Name,Topics[1]. TopicItems[I].DisplayName)
}

Methods:

AuditSQL(EventType as BqAuditEventType, SQLString as String) SyncWithDatabase()

Properties:

Read-only: TimeLimitActive as Boolean

Read-write: Property AutoAlias As Boolean, Property AutoJoin As Boolean, Property RowLimit as Number, RowLimitActive as Boolean, Property ShowIconJoins As Boolean, Property TimeLimit As Number, Property TimeLimitActive

Objects:

Catalog As DMCatalog, Connection As Connection, MetaDataConnection As Connection, JoinOptions as JoinOptions

Collections:

Joins As Joins, Limits As Limits, Topics As Topics, Local Results as LocalResults, LocalJoins as LocalJoins