November 17, 2004 at 8:08 am
I have an instrument (thermometer) with a built-in web server that responds to a HTTP Get statement and returns a string (Probe1|25.6|Probe 2| 28.4).
I need to figure out how to run the GET command from a stored procedure (or DTS) so I can load the string into the database at regular intervals through scheduled job.
Any suggestions?
Thanks,
Jakub
November 18, 2004 at 1:58 am
Hi,
My first idea would be to use DTS, and have a look at ActiveX Script Task and use XMLHTTP ...
Found smth on Google also, tested it, works. See http://dbforums.com/t903687.html.
Make sure you notice the difference between ServerXMLhttp and XMLhttp.
Have fun!
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim strURL, oBrowser
dim serverPath
dim scriptPath
serverPath = "http://www.hr-technologies.com/content/"
scriptPath = "page.asp"
strURL =serverPath & scriptPath
set oBrowser = CreateObject("Microsoft.XMLHTTP")
oBrowser.Open "GET" , strURL , false , "" , ""
oBrowser.send
msgbox oBrowser.responsetext
set oBrowser = nothing
Main = DTSTaskExecResult_Success
End Function
November 18, 2004 at 9:42 am
Worked like a charm!!
Thanks!
February 2, 2006 at 10:28 pm
When i run the script from the Package Window it works fine, but when I call the Package using the sp_OACreate in a Stored Procedure. The responseText does not work. Any suggestions? I am trying to save the xml file using responseXML.save and that does not work either.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy