Type | Description | |||
Name as String | A String expression that defines the name of the data-source. | |||
Variant | A String expression that could refer a file such as XML, ACCDB, MDB or DBF, or an object of XML, ADO or DAO type |
Based on the DataTechnology and DataSource properties, the control can use any of the following technologies:
to bound the host to a data-source.
If using the XML (Extensible Markup Language) technology, only following properties are required:
The following sample bounds the control XML (Extensible Markup Language) way:
With G2Host1 .DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml" .DataField(exItemsDataSource) = "Items" End With
When using the XML (Extensible Markup Language) technology the control uses the Host's LoadXML and SaveXML to perform savings.
When using the ADO (ActiveX Data Objects) or DAO (Data Access Object) technology, the following properties are required ( items/columns section ):
The following sample bounds the items ADO (ActiveX Data Objects) or DAO (Data Access Object) way:
With G2Host1 .DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb" .DataMember("Items") = "Employees" .DataField(exItemsDataSource) = "Items" End With
A) When using the ADO (ActiveX Data Objects) or DAO (Data Access Object), the tasks can be loaded/saved to the same data-source as items, and so only one task is possible per item, so in this case the following properties are required ( chart/tasks section ):
The following sample bounds the items and tasks (same table ) ADO (ActiveX Data Objects) or DAO (Data Access Object) way:
With G2Host1 .DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb" .DataMember("Items") = "Employees" .DataField(exItemsDataSource) = "Items" .DataField(exTasksDataSource) = .DataField(exItemsDataSource) .DataField(exTasksStart) = "BirthDate" .DataField(exTasksEnd) = "HireDate" End With
B) When using the ADO (ActiveX Data Objects) or DAO (Data Access Object), the tasks can be loaded/saved from a different data-source, the following properties are required ( chart/tasks section ):
in addition for items/columns section, the following is required too:
The following sample bounds the items and tasks (different tables ) ADO (ActiveX Data Objects) or DAO (Data Access Object) way:
With G2Host1 .DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb" .DataMember("Items") = "Employees" .DataField(exItemsDataSource) = "Items" .DataField(exItemsID) = "EmployeeID" .DataSource("Tasks") = .DataSource("Items") .DataMember("Tasks") = "EmployeeDetails" .DataField(exTasksDataSource) = "Tasks" .DataField(exTasksItemID) = "EmployeeID" .DataField(exTasksStart) = "DateStart" .DataField(exTasksEnd) = "DateEnd" End With
When using the ADO (ActiveX Data Objects) or DAO (Data Access Object), the links can be loaded/saved from a different data-source, so the following properties are required ( chart/links section ):
in addition for chart/tasks section, the following is required too:
The following sample bounds the items, tasks and links (different tables ) ADO (ActiveX Data Objects) or DAO (Data Access Object) way:
With G2Host1 .DataSource("Items") = "C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb" .DataMember("Items") = "Employees" .DataField(exItemsDataSource) = "Items" .DataField(exItemsID) = "EmployeeID" .DataSource("Tasks") = .DataSource("Items") .DataMember("Tasks") = "EmployeeDetails" .DataField(exTasksDataSource) = "Tasks" .DataField(exTasksItemID) = "EmployeeID" .DataField(exTasksStart) = "DateStart" .DataField(exTasksEnd) = "DateEnd" .DataField(exTasksID) = "TaskID" .DataSource("Links") = .DataSource("Items") .DataMember("Links") = "EmployeeLinks" .DataField(exLinksDataSource) = "Links" .DataField(exLinksStart) = "Start" .DataField(exLinksEnd) = "End" End With