XMLHTTP In DTS?

  • One of my data vendors only provides the data file through a web interface.  So I created an ASP page that will grab the file and save it to the hard drive on my server. 

    I moved this into an Active X script in a DTS package and it just seems to hang.

     

    Sub SubGet_Data(varURL, varFile)

     Set xmlhttp = CreateObject("Msxml2.SERVERXMLHTTP")

     xmlhttp.Open "GET", varURL, false

     xmlhttp.Send(Now)

     'Create a Stream

     Set adodbStream = CreateObject("ADODB.Stream")   

     'Open the stream

     adodbStream.Open

     adodbStream.Type = 1 'adTypeBinary

     adodbStream.Write xmlhttp.responseBody

     adodbStream.SaveToFile varFile, 2 'adSaveCreateOverWrite

     adodbStream.Close

     Set adodbStream = Nothing

     Set xmlhttp = Nothing

    End Sub

  • What is the Now in the xmlhttp.Send(Now) line ? I suppose it should be xmlhttp.Send() ...

  • What I was told by Microsoft Tech support when I ran into this problem was that SQL Server 2000 has a bug with this line:

     

    Set xmlhttp = CreateObject("Msxml2.SERVERXMLHTTP")

     

    It can create other objects just fine, except this one! Go figure.

    hth

    frank

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply