Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hit a url without openning IE

Status
Not open for further replies.

AppDev76

Programmer
Jun 8, 2004
65
0
0
US
Hi,
I have a package set up on a SQL Server, the first step is to hit an asp page. I initialy had the following vbscript code (under an Active X script task):
-----------------
Function Main()
Set ae = CreateObject("InternetExplorer.application.1")
ae.visible=false
ae.Navigate " CONST READYSTATE_COMPLETE =4
Do While ae.ReadyState <> READYSTATE_COMPLETE
Loop
ae.quit
If Err.Number>0 Then
Main=DTSTaskExecResult_Failure
Else
Main= DTSTaskExecResult_Success
End If
End Function
---------------------------
But the problem is that the job runs under a service accout on SQL Server and a service account can't open internet explorer on the server.
Anyway, my question at this point is:
What is the best way to hit a url without opening ie?

Thanks
 
Never mind, I used MSXML2

Function Main()

Dim xmlhttp
Dim result
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

xmlhttp.Open "GET", "myurl",true
xmlhttp.Send



Do While xmlhttp.readyState <> 4
Loop

If Err.Number>0 Then
Main=DTSTaskExecResult_Failure
Else
Main= DTSTaskExecResult_Success
End If

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top