Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 ActiveX Variable to ExecuteSQLTask

Author  Topic 

shaneschmidt
Starting Member

17 Posts

Posted - 2002-11-11 : 22:58:32
Guys
Im trying to pass an ActiveX variable ErrorCount
which counts all error files in a directory . This variable is assigned to a global variable . How can I pass this variable
to an execute SQL task outside this script. Im trying to update our job log. Update where etc. errorcount = global variable. But have had no luck.

Function Main()
On Error Resume Next
DTSGlobalVariables("ErrorCount").Value = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = so.GetFolder TSGlobalVariables"Snmp_Errors_Dir"))
ErrorCount = 0
Set FolderFiles = Folder.Files
For Each NextFile In FolderFiles
strFileName = NextFile.Name
If (Left(strFileName, 5) = "snmp_") Then
ErrorCount = ErrorCount + 1
End If
Next

If ErrorCount > 0 Then
Main = DTSTaskExecResult_Success
msgbox(ErrorCount)
Else
Main = DTSTaskExecResult_Success
msgbox(ErrorCount)
End If

End Function


Tim
Starting Member

392 Posts

Posted - 2002-11-14 : 20:36:52
if your activeX task is storing a value into a global variable, you can get the ExecSQL task to use it via a parameter.

Eg:

ActiveX sets gName = "Tim"

EXecSQL Task = "SELECT * FROM People where Name = ?"

In the parameters dialog of the Exec SQL Task properties, set the first parameter to gName.



----
Nancy Davolio: Best looking chick at Northwind 1992-2000
Go to Top of Page
   

- Advertisement -