2 Replies Latest reply on Aug 3, 2016 12:54 PM by Darris Friend

    MMDBVersion in MM_System_Persist_Info table

    Darris Friend

      I see there is a blob value field in TreeName MMDBVersion but using SQL Server Management Studio I can not extract the value from the Data field. What I am trying to discover is the ArcFM version in the geodatabase.

        • Re: MMDBVersion in MM_System_Persist_Info table
          Neil Etheridge

          Hi Darris,

           

          I've only ever managed to extract the Design XML from the MM_HIDDEN_PACKAGES table via SQL.  Otherwise I've had to use C#.  The value in the DATA column of the MM_SYSTEM_PERSIST_INFO table is a serialised ID8List - I've thrown together an AddIn that will extract the MMDBVersion data - the core of the addin is in the OnClick method listed below.  The finished AddIn is also attached - just download and double click it to install.  Then open the ArcCatalog customise dialog, look under a category called Spikearelli and drag the tool to your favourite toolbar.  Select your database and click the tool.

           

                  protected override void OnClick() {
          
          
                      // Get the database connection object from Catalog
                      IGxApplication gxApp = ArcCatalog.Application as IGxApplication;
                      IGxObject gxObj = gxApp.SelectedObject;
                      if (gxObj == null || !(gxObj is IGxDatabase2)) {
                          MessageBox.Show("Database not selected.", _toolName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                          return;
                      }
          
          
                      // Grab the worksapce from the connection
                      IGxDatabase2 gxDB = gxObj as IGxDatabase2;
                      IWorkspace workspace = gxDB.Workspace;
          
          
                      // Create an empty list to load the tree into
                      Type typeFromProgID = Type.GetTypeFromProgID("mmFramework.D8List");
                      ID8List list = (ID8List)Activator.CreateInstance(typeFromProgID);
          
          
                      // Load the list from the tree
                      IMMPersistentListItem persistentList = list as IMMPersistentListItem;
                      if (persistentList.CanLoadFromDB(workspace)) {
                          persistentList.LoadFromDB("MMDBVersion", workspace);
          
          
                          // Read the attributes
                          _attributes.Clear();
                          PersistInfoAttributes((ID8List)persistentList);
          
          
                          // Display the result
                          StringBuilder displayString = new StringBuilder();
                          foreach (string attribute in _attributes) {
                              displayString.AppendLine(attribute);
                          }
                          MessageBox.Show(displayString.ToString(), _toolName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                      } else {
                          MessageBox.Show("Unable to read from the MM_SYSTEM_PERSIST_INFO table.", _toolName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                          return;
                      }
          
          
                  }