dbTalk Databases Forums  

"Object Required" error in ActiveX task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss "Object Required" error in ActiveX task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kayda
 
Posts: n/a

Default "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


Reply With Quote
  #2  
Old   
kayda
 
Posts: n/a

Default Re: "Object Required" error in ActiveX task - 08-11-2005 , 09:21 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.