dbTalk Databases Forums  

Re: Urgent assistance wih DTS

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


Discuss Re: Urgent assistance wih DTS in the microsoft.public.sqlserver.dts forum.



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

Default Re: Urgent assistance wih DTS - 12-05-2006 , 04:07 PM






Have you tried the sample code as is?

Why are you creating objects? The Files collection comes from the variable,
you do not need to create new instances of the objects, use the Files
collection provided.


By the way when using CreateObject and a ProgID you should quote the value.


--
Darren
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

"Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I am trying to use the SQLDTS (http://www.sqldts.com/default.aspx?302) Ftp
component. It works fine downloading the file. The problem I have is
trying
to enumerate it to get the list of file names.

I tried this

Function Main()
Dim oFTPFiles
Dim oFTPFile

Set oFTPFiles = CreateObject(SQLDTSFTPTask.Files)
Set oFTPFile =
CreateObject("{5016A652-8FEA-4F06-90E2-6522F4E7C5AE}")

'Set oFTPFiles = DTSGlobalVariables("fileName").Value

'For Each oFTPFile In oFTPFiles
' MsgBox oFTPFile.Name
'Next

Set oFTPFile = Nothing
Set oFTPFiles = Nothing

Main = DTSTaskExecResult_Success

End Function


Both variable declaraton doesn't seem to work. The first one gives the
error

Error Code: 0

Error Source= Microsoft VBScript runtime error

Error Description: Object required: 'SQLDTSFTPTask'

Error on Line 8

and the second one gives

Error Code: 0

Error Source= Microsoft VBScript runtime error

Error Description: ActiveX component can't create object:
'{5016A652-8FEA-4F06-90E2-6522F4E7C5AE}'

Error on Line 9

Any ideas. I have been trying for hours on this simple crap.

Thanks



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.