Model Installer Reference

Meta Data Services Programming

Meta Data Services Programming

Model Installer Reference

The Microsoft® SQL Server™ 2000 Meta Data Services information model installer reads a binary information model RDM file and installs the information model in the specified repository database. The installer can be used to install either prebuilt information model installation files, such as those provided with the Meta Data Coalition (MDC) Open Information Model (OIM), or user information model files generated by the Model Development Kit (MDK). A user model must be successfully compiled by the MDK before it can be installed on a repository database. The compiling process creates the .rdm input string for the model installer.

The model installer has a dependency on the repository engine DLL. It will read the installation script and create the information model in the specified repository.

The installer is compatible with earlier versions of the Meta Data Services repository .rdm files and handles them correctly.

When the model installer recognizes that the model already exists, it will check to see whether any additions have been made (classes, interfaces, properties, collections, relationships, methods, and so on) and reinstall them as required.

Command Line Installer

The command line installer uses the Installer COM server DLL to perform the actual installation or deletion of model files. It outputs any error message to the console window.

The syntax of the two possible command lines are:

   InsRepIM.exe /f[Model File] /r[Repository connect string] /u[User] /p[Password]

-or-

   InsRepIM.exe /d /r[Repository connect string] /u[User] /p[Password]

Warning  Using the flag /d deletes all repository tables and property tables from the repository database that are specified by the connection string using the user ID and password.

The following table lists the parameters.

Parameter Description
Model File The information model data file (with a file extension of .rdm)
Repository connect string The repository database file data source name (DSN) or a Microsoft Access database file (with a file extension of .mdb)
User The user's name
Password The user's password
Example

The following examples show how you can use either the DSN or the .mdb to identify the file name:

   InsRepIM /f C:\MyRdmFolder\Mar.rdm /r DSN=Mar /u MyName /p MyPassword

   InsRepIM /f C:\MyRdmFolder\Mar.rdm /r C:\MyMdbFolder\Mar.mdb /u MyName /p MyPassword
Installer COM API

The model installer API is the same as in Microsoft Repository version 2.0. The IMInstall COM server publishes the IMInstall interface.

The file Insrepim.dll is a Microsoft ActiveX® DLL located in C:\Program Files\Common Files\Microsoft Shared\Repository. It can be used either from a Microsoft Visual Basic® application or a Microsoft Visual C++® application to programmatically install a model file into a repository database.

Topic Description
IIMInstall::InstallRDM Method Describes the method that is used to install the model by DSN or connection name
IIMInstall2::InstallRDM Method Describes the method that is used to install the model by repository pointer
Model Installer Errors Lists the model installer error messages

The model installer uses the following sample Interface Definition Language (IDL) definition to install models into a Meta Data Services repository.

IDL Definition

IDL Segment

   [
      object,
      uuid(D24FD4A4-BEBC-11D1-8CB9-00C04FC2F51A),
      dual,
      helpstring("IIMInstall Interface"),
      pointer_default(unique)
   ]
   interface IIMInstall : IDispatch
   {
      [id(1), helpstring("method InstallRDM")] HRESULT InstallRDM([in] BSTR DSN, [in] BSTR RDMFile, [in] BSTR UserName, [in] BSTR Password);
   };

   [
      object,
      uuid(AF7F843B-FB34-4ff2-BD7D-81DDB284D2A9),
      dual,
      helpstring("IIMInstall2 Interface"),
      pointer_default(unique)
   ]
   interface IIMInstall2 : IDispatch
   {
      [id(1), helpstring("method InstallRDM")] HRESULT InstallRDM([in] IRepository *pRepos, [in] BSTR RDMFile);
   };

See Also

Installing Information Models

Model Installer Errors