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

sql server dts

group:

"Object Required" error in ActiveX task


"Object Required" error in ActiveX task kayda
8/11/2005 6:02:11 PM
sql server dts:
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
Re: "Object Required" error in ActiveX task kayda
8/11/2005 6:21:03 PM
I had my SQL statement at the end of an insert. I took it out and made
it its own SQL task and that seemed to work, guess it wasn't setting
the variable.

Thanks,
Kayda
AddThis Social Bookmark Button