How can I set Construct string( which is on Activation tab) in COM+ installation?
How can I set Construct string( which is on Activation tab) in COM+ installation?
You need to navigate through COMAdmin for this
code for reference only..
svAppID is the COM+ application ID guid
svClsID is the class ID of the dll to update with the constructor str.
Code:Set objCatalog = CreateObject("COMAdmin.COMAdminCatalog") Set objAppColl = objCatalog.GetCollection("Applications") objAppColl.Populate '// Update ComCatalog For i = 0 To objAppColl.Count - 1 If objAppColl.Item(i).Key = svAppID Then Set objCmptColl = objAppColl.GetCollection("Components", svAppID) objCmptColl.Populate For j = 0 To objCmptColl.Count - 1 If objCmptColl.Item(j).Key = svClsID Then If Not IsNull(svConstruct) Then Set objCmpt = objCmptColl.Item(j) objCmpt.Value("ConstructionEnabled") = True objCmpt.Value("ConstructorString") = svConstruct objCmptColl.SaveChanges objLog.WriteLine " Updated Class " & svClsID & " in " & svAppID objLog.WriteLine " Construction Enabled with """ & svConstruct & """" End If Exit For End If Next Exit For End If Next
Thanks. Right in the point.
Michail
Originally posted by Keppler
You need to navigate through COMAdmin for this
code for reference only..
svAppID is the COM+ application ID guid
svClsID is the class ID of the dll to update with the constructor str.
Code:Set objCatalog = CreateObject("COMAdmin.COMAdminCatalog") Set objAppColl = objCatalog.GetCollection("Applications") objAppColl.Populate '// Update ComCatalog For i = 0 To objAppColl.Count - 1 If objAppColl.Item(i).Key = svAppID Then Set objCmptColl = objAppColl.GetCollection("Components", svAppID) objCmptColl.Populate For j = 0 To objCmptColl.Count - 1 If objCmptColl.Item(j).Key = svClsID Then If Not IsNull(svConstruct) Then Set objCmpt = objCmptColl.Item(j) objCmpt.Value("ConstructionEnabled") = True objCmpt.Value("ConstructorString") = svConstruct objCmptColl.SaveChanges objLog.WriteLine " Updated Class " & svClsID & " in " & svAppID objLog.WriteLine " Construction Enabled with """ & svConstruct & """" End If Exit For End If Next Exit For End If Next