'**-- FOR PRIVATE USE function prvXMLRequestExecute(strURL) dim oDom set oDom = CreateObject("Microsoft.XMLDOM") oDom.async = False oDom.load strURL prvXMLRequestExecute = oDom.xml set oDom = nothing 'dim objXmlHttp ' ' Set objXmlHttp = CreateObject("Microsoft.XMLHTTP") ' ' '**-- execute request to server and return XML ' call objXmlHttp.Open("GET", strURL, false) ' call objXmlHttp.send() ' ' prvXMLRequestExecute = objXmlHttp.responseText ' ' Set objXmlHttp = nothing end function '**-- FOR GLOBAL USE function XMLRequestExecute(strURL) dim sResponse dim oDom dim oElmntErr '**-- execute request sResponse = prvXMLRequestExecute(strURL) '**-- check if returned something if sResponse = "" then MsgBox "[EMPTY STRING]" & vbCrLf & "URL:" & strURL,vbCritical,"XMLRequestExecute" exit function end if '**-- check response for errors set oDom = CreateObject("MSXML.DOMDocument") oDom.loadXML sResponse '**-- check if xml OK if oDom.xml = "" then MsgBox "[BAD XML]" & vbCrLf & "URL:" & strURL & vbCrLf & "XML:" & sResponse,vbCritical,"XMLRequestExecute" exit function end if '**-- check if this is not Error XML '**-- if it is then check SQL in XMLHTTP Handler (ASP page) set oElmntErr = oDom.documentElement.selectSingleNode("./Error") if not oElmntErr is nothing then MsgBox "[ERROR]" & vbCrLf & "URL:" & strURL & vbCrLf & "ERR XML:" & oElmntErr.xml, vbCritical,"XMLRequestExecute" exit function end if '**-- return XML representing Recordset XMLRequestExecute = oDom.documentElement.firstChild.xml set oDom = nothing set oElmntErr = nothing end function '**-- check if response is ok (in case it's came from update or delete request) function GetXMLResponseText(sResponse) dim oDom dim oElmntRsp set oDom = CreateObject("MSXML.DOMDocument") oDom.loadXML sResponse if oDom.xml = "" then exit function end if set oElmntRsp = oDom.documentElement GetXMLResponseText = oElmntRsp.text set oDom = nothing set oElmntRsp = nothing end function