"Object Required" error in ActiveX task -
08-11-2005
, 09:02 PM
Hi:
I can't for the life of me see where the problem here-I'm getting a
runtime error - "object required - 'objRS'. (referencing the line where
I try to access the record set for the first time - the 'FilePath =
objRS.Fields(0)' line). The "Intervals_RecordSet" is a global variable
that is supposed to be set by the SQL task before the ActiveX task (the
SQL task sets an output parameter of type recordset). This is the
beginning of a loop that might be returned to later on by an ActiveX
task that comes further in the package, but I don't get that far
because of this error.
Any ideas? The SQL code is below and the ActiveX script is below that.
----------------
SQL Task Code:
-----------------
SELECT C_Filepath, Date_time FROM Interval_Update_List:
-------------------
Active X Task Code:
-------------------
Option Explicit
Function Main()
Dim pkg
Dim conTextFile
Dim FilePath
Dim objRS
set pkg = DTSGlobalVariables.Parent
set conTextFile = pkg.Connections("AgentContactData")
Set objRS = DTSGlobalVariables("Intervals_RecordSet").Value
FilePath = objRS.Fields(0)
DTSGlobalVariables("Date_Time_For_Pump").Value = objRS.Fields(1)
conTextFile.DataSource = FilePath
IF NOT objRS.EOF then
objRS.MoveNext
END IF
Set objRS = nothing
End Function
Thanks,
Kayda |