dbTalk Databases Forums  

download files in DTS package?

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


Discuss download files in DTS package? in the microsoft.public.sqlserver.dts forum.



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

Default download files in DTS package? - 03-11-2005 , 01:47 PM






Hi!



I need a help!!



How to download files in DTS package?



Tanks



Joao



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: download files in DTS package? - 03-11-2005 , 01:57 PM






Option Explicit

Function Main()

Dim sUrl
Dim xmlHttp
Dim response

sUrl = "http://www.website.com/file.dat"

Set xmlhttp = CreateObject("MSXML4.ServerXMLHTTP")
xmlhttp.Open "GET", sUrl, False
xmlhttp.Send
response = xmlHttp.ResponseBody
Set xmlHttp = Nothing


Dim oADOStream
Set oADOStream = CreateObject("ADODB.Stream")
oADOStream.Type = 1 '(Binary)
oADOStream.Mode = 3 '(read / write)
oADOStream.Open
oADOStream.Write response
oADOStream.SaveToFile "C:\Test.dat", 2
oADOStream.Close
Set oADOStream = Nothing

Main = DTSTaskExecResult_Success
End Function


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Joao Mossmann" <mossmann (AT) feevale (DOT) br> wrote

Quote:
Hi!



I need a help!!



How to download files in DTS package?



Tanks



Joao





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.