all groups > sql server dts > august 2006 >
You're in the

sql server dts

group:

ActiveX Error possibly from global variables?


ActiveX Error possibly from global variables? dtaylo04 NO[at]SPAM gmail.com
8/25/2006 10:26:33 AM
sql server dts:
I'm rewriting all of our sql2000 dts packages in ssis for our upgrade.
One of my packages has several ActiveX scripts. The script checks to
see if a marker file is available and if it is, it proceeds to run the
rest of the package. If there's a better (easier) way of doing this I
am all for it. But since I don't know of any otehr way, I'm trying to
reuse the ActiveX script. Upon execution I get an error: "Error at
Check for marker file [ActiveX Script Task]: Funciton not found." I
have no idea what this is all about.

I've created 2 global variables:
done_file string done_dsr.txt
remote_share string D:\test\

Here's the script code:
Function Main()
Dim oFSO, oDrive, oFolder
Set oFSO=CreateObject("Scripting.FileSystemObject")
Set oDrive=oFSO.GetDrive(DTSGlobalVariables("remote_share").Value)
if oDrive.IsReady then
Set oFolder=oDrive.RootFolder
if
oFSO.FileExists(oFSO.BuildPath(oFolder.Path,DTSGlobalVariables("done_file").Value))
then
Main=DTSTaskExecResult_Success
else
Main=DTSTaskExecResult_Failure
end if
else
Main = DTSTaskExecResult_Failure
end if
End Function

If anyone has any suggestions or ideas, I'm all ears (or eyes in this
case).

Thanks in advance,
David
RE: ActiveX Error possibly from global variables? Charles Kangai
8/27/2006 2:18:02 PM
ActiveX scripts are only supported for backward compatibility in SSIS. For
new developments you should use the Script Task. ActiveX Script task is kept
so that upgrades of DTS packages that have ActiveX tasks work. Having said
that, there are some things that won't work after you have upgraded your
ActiveX scripts. I don't know the full list of features which don't work, but
you may have hit upon one.

Try using the Script task and .NET script to do what you are trying to do.
Here is an example of a VB.NET script that checks whether a file exists. You
can expand on it: (You have to use Imports System.IO to make it work)

Dim strFileName As String
strFileName = "C:/MyFile.txt"
Dim oFile As New FileInfo(strFileName)
If Not oFile.Exists Then
MessageBox.Show("File does not exist")
Else
MessageBox.Show("File Found")
End If

Hope this helps.

Charles Kangai, MCT, MCDBA
Author of Learning Tree's 4-day course: "SQL Server 2005 Integration
Services"
Author of Learning Tree's 4-day course: "SQL Server Reporting Services"




[quoted text, click to view]
AddThis Social Bookmark Button