Tuesday, March 20, 2012

ACTIVE X SCRIPT ERROR

I have the following code in an ActiveX Script task for SSIS 2005 package... This worked about a year ago when it was first developed. I am coming in to try to update some things and i am running into this problem

Function Main()

Dim crDocument

Dim crApp

Dim sCRConnectionString

Dim crTable

strServer = DTSGlobalVariables("DBServer")

strDatabase = DTSGlobalVariables("DBName")

strCR = DTSGlobalVariables("CrystalReportPath")

strOutput = DTSGlobalVariables("OutputPath")

sFileOutputPDF = strOutput & "EventLogReport.pdf"

strReportLocation = strCR & "LoggedEvents.rpt"

Set crApp = CreateObject("CrystalRuntime.Application")

Set crDocument = crApp.OpenReport(strReportLocation )

sCRConnectionString = "Provider=SQLOLEDB;server=" & strServer & ";database=" & strDatabase & ";Integrated Security=True"

crDocument.DisplayProgressDialog = False

crDocument.ExportOptions.DestinationType = 1

crDocument.ExportOptions.DiskFileName = sFileOutputPDF

crDocument.ExportOptions.FormatType = 31

MSGBOX("EXPORTING..")

crDocument.Export(False)

MSGBOX("EXPORTING FINISHED!!")

Main = DTSTaskExecResult_Success

End Function

It makes it to the "Exporting.." msg box and then i get the following error

Error: 0xC0048006 at ActiveX Script Task, ActiveX Script Task: Retrieving the file name for a component failed with error code 0x0173DA5C.

At first I thought it may have been an issue with the crystal report having a popup or something come up while this was executing.. but I was able to open the crystal and export the data to a pdf no problem... Any suggestions?

Thanks in Advance!!!

Just an FYI - and not what you want to hear likely, but you should spend your time to convert this to an SSIS Script Task, written in VB.Net. ActiveX is a depricated feature of SSIS.

http://technet.microsoft.com/en-us/library/ms137525.aspx|||

how do i convert

Dim crDocument

Dim crApp

Set crApp = CreateObject("CrystalRuntime.Application")

Set crDocument = crApp.OpenReport(strReportLocation )

into VB.Net for the SSIS Script task... do i also need to import anything? when i right clicked references in the project explore window of the script task editor, i did not see any references that related to crystal?

Thanks in advance

No comments:

Post a Comment