Data Model > UNICOM Intelligence Data Model samples > UNICOM Intelligence Data Model-related sample code > Creating the Aliases Visual Basic sample
 
Creating the Aliases Visual Basic sample
This sample demonstrates setting up aliases for each VariableInstance object in an MDM Document and subaliases for each multiple response VariableInstance object. There are two examples, one uses the default configuration of the Alias Map Generator object, the other amends the default configuration in a minor way. For more information about configuring the generator, see Examples of configuring the Generator.
Note that the sample uses the CreateAliasName and CreateSubAliases properties on the VariableInstance object to create the aliases and subaliases. These are MDM functions that access the Alias Map component. Although they enable you to control the Generator object, MDM retains control of the Dictionary object to ensure correct serialization and to maintain the relationship between the aliases and subaliases and their associated VariableInstance objects. This means that when you use these functions, you cannot control the Dictionary object.
The sample also demonstrates checking the Document.DataSources collection for a DataSource object relating to a specific DSC and creating a new DataSource object if a suitable one does not exist. This is necessary because VariableInstance aliases and subaliases are specific to a particular DataSource object and cannot be set until the current DataSource (Document.DataSources.Current) has been set up appropriately.
By default, this sample is installed into the [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Code\General\VB6\Create Aliases folder.
The sample uses the museum_qq.mdd file, which is installed by default into [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Mdd. If the sample .mdd files are stored in a different location on your computer, you will need to edit the sample accordingly before you run it.
See also
Working with the Alias Map component
UNICOM Intelligence Data Model samples
UNICOM Intelligence Data Model-related sample code