Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close or Supress MsgBox in VB ActiveX Script for DTS Package 1

Status
Not open for further replies.

bustercoder

Programmer
Mar 13, 2007
96
Hello,

In my DTS Package, I have this Visual Basic ActiveX Script, I use for testing to make sure the FTP operation was successful. I'd like to keep it inthe DTS package for future testing, but don't want the msgbox to pop up when running as a scheduled task in production. Is there a way to suppress the msgbox or close it after it opens?

Function Main()
' transmission report
dim message
dim rc

if DTSGlobalVariables("TransferredFileCount") = 1 then
message = "Successfully transferred " & DTSGlobalVariables("TransferredFileCount") & " file."
rc = DTSTaskExecResult_Success
else
message = "Error! transferred " & DTSGlobalVariables("TransferredFileCount") & " files."
rc = DTSTaskExecResult_Failure
end if
msgbox message
Main = rc
End Function

Thanks,
Bruce

 
maybe you can choose an alternate output mechanism like writing to a log file that will work in both scenarios.

[COLOR=#aa88aa black]Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt.[/color]
 
use a global variable for example ServerName
then assign the server name to the global var (for example with a dynamic properties task (select @@servername)), if the server name is production then don't display it, if it is staging then do

If DTSGlobalVariables( "ServerName" ).Value ="Staging"
msgbox message
end if



Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top