Red Gate forums :: View topic - Modal dialog box exception.
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare Previous Versions
SQL Data Compare Previous Versions forum

Modal dialog box exception.

Search in SQL Data Compare Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
jschwarz



Joined: 16 Jun 2011
Posts: 7

PostPosted: Wed Nov 09, 2011 12:42 am    Post subject: Modal dialog box exception. Reply with quote

I have created a stored procedure that will call a powershell script that subsequently executes a Sql Data Compare from the command line.

The stored proc passes variables to the powershell script that generates the Data Compare Command and executes it.

This is the os command that calls the powershell script...

sqlps.exe -Command "F:\MSSQL\Powershell\scripts\DataCompareExtract.ps1 -Server1 'TSTSQL1' -Database1 'Research' -LocalSVNPath 'F:\MSSQL\Subversion\' -TableList '\[dbo\]\.\[tDataAudit\]'"

This in turn executes the following from the command line...
&"C:\Program Files (x86)\Red Gate\SQL Data Compare 9\sqldatacompare" /Server1:TSTSQL1 /database1:Research /scr2:F:\MSSQL\Subversion\Research /include:Table:\[dbo\]\.\[tDispersionMultiplierAudit\] /synchronize

Both of these commands run successfully when executed from the command line. However, when executed via the stored proc, I receive the following error stack...
Red Gate SQL Data Compare Command Line Utility V9.1.0.365

Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at RedGate.SQLTools.SmartUsageReportingWithAdvancedUI.UsageReporterWithUI.AskUserForReportUsageConfirm()
at RedGate.SQLTools.SmartUsageReportingWithAdvancedUI.UsageReporterWithUI.ChooseWhetherToSendReport()
at RedGate.SQLTools.SmartUsageReportingWithAdvancedUI.UsageReporterWithUI.CheckAgreedToUsageReports()
at RedGate.SQLTools.SmartUsageReportingWithAdvancedUI.UsageReporterWithUI.CanReportUsage()
at #zRX.#ARX.#eI6(#8U0 )
at #zRX.#ARX.#9Lj.#bSj.#crZ()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Does anyone have any idea why these would execute ok from the command line, but receive this error when executed via a stored proc?
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Wed Nov 09, 2011 10:31 am    Post subject: Reply with quote

Thanks for your post.

I believe the dialogue box it's trying to display is the licensing client. It does this when it doesn't find the licensing information and believes the tool is unlicensed.

I take it that SQL Data Compare Pro is activated on the SQL Server, so the problem might be that the account running the job doesn't have access to licensing information.

Can you make sure that the account used for the job can read:
x64: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Red Gate
x86: HKEY_LOCAL_MACHINE\SOFTWARE\Red Gate

C:\ProgramData\Red Gate\Licenses

I hope this helps.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
jschwarz



Joined: 16 Jun 2011
Posts: 7

PostPosted: Mon Nov 21, 2011 4:36 pm    Post subject: Reply with quote

Chris, you were close... the dialogue box that it's trying to display is the box that asks if I would like to "help improve RedGate Software".

I did check the registry, and add permissions as you suggested. I still encountered the same problem.

In order to get this error to disappear, I had to log into the server as the service account that ends up executing the stored proc, and manually run SQL Data Compare from the command line, and click through the "help improve RedGate" pop-up. Now it will work when executed through the stored proc.

Although I did click "No" on the "help improve RedGate" prompt, I do have a suggestion...
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Nov 21, 2011 4:41 pm    Post subject: Reply with quote

ah ok, that would be:

HKEY_CURRENT_USER\Software\Red Gate\SQL Tools\SmartAssemblyReportUsage

Thanks for the update.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group