Has anyone successfully implemented a Compare and Merge using the MergeModel Object for Forward Engineering? I have a macro that calls both the MergeReport and DoMerge methods using a QuickLaunch created through the UI, but both methods just cause an application crash. I've tried it in version 11 and version 2017, and the same thing happens. I had created a case with Idera, but was wondering if anyone has successfully done this.
Were you able to get any information from support on this? I've been able to successfully run a compare against a live database to generate an alter script.
No, I haven't heard anything from support. Can you post your macro?
Here's the macro I'm using. You might want to see if maybe it's a permission issue on one of the folders you're accessing. I worked with someone where certain macros didn't work on some machines but worked fine on others. If you are able, try running your macro on a different machine and see if you still get the same problem.
' compare and merge
Const IGNORE As Integer = 0
Const MERGE_ALL_TO_TARGET As Integer = 1
Const MERGE_ALL_TO_CURRENT As Integer = 2
Const FILE_PATH = "C:\temp\CM\"
Dim theDiagram As Diagram
Dim theModel As Model
Dim fileName As String
Dim DataModelFileName As String
Dim QuickLaunchFileName As String
Dim ComparisonReportFileName As String
On Error GoTo errHandler
QuickLaunchFileName = FILE_PATH & "compare.cmo"
ComparisonReportFileName = FILE_PATH & "lsip_diff.rtf"
Set theDiagram = DiagramManager.ActiveDiagram
Private Sub doCompare(QuickLaunchFileName As String, ComparisonReportFileName As String, Decision As Integer)
Dim theMergeObj As MergeModel
Set theModel = theDiagram.ActiveModel
Set theMergeObj = theDiagram.MergeModelObject
theMergeObj.MergeReport(QuickLaunchFileName, ComparisonReportFileName,1, 0)
Function CheckOp(Optional opRetVal As Variant = Nothing)
Dim errorCode As Integer
errorCode = DiagramManager.GetLastErrorCode()
If (errorCode <> 0) Then
Err.Raise Number := vbObjectError + errorCode, _
Source := "Macro error handler", _
Description := DiagramManager.GetLastErrorString()
Hi Stanley, Thanks for sharing it.
May i know is is possible to achieve the compare and merge by connecting to database and browse the tables and column through macro. I am looking for a way to connect to a database (TeraData) from ER studio macro if its possible. Any sample code will be greatly appreciated.
Powered by IDERA