Re: Opening XML file over HTTPS with ADODB on a web page.




"Josiah Fizer" <Josiah Fizer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2303D343-898A-4966-9EA1-EA9BF945A670@xxxxxxxxxxxxxxxx
The following code works to open a remote XML file into the
ADODB.Recordset,
however no data is returned if the URL for the XML file is using SSL
(HTTPS).
My thinking is that I need a diferent connection string. However I'm
unsure
as to which one would work. The only error I get is [Object Error].

<script language=javascript>
function LoadData()
{
var objRecordset = new ActiveXObject('ADODB.Recordset');
var strConnectionString = 'Provider=MSPERSIST';
var strQuery = jsvProtocolServer; // URL for the XML file
try {
objRecordset.Open(strQuery, strConnectionString);
if (!objRecordset.EOF)
{
document.pt.DataSource = objRecordset;
//Automatically displays all columns on the pivottable
document.pt.ActiveView.AutoLayout();
}
}
catch(e) {alert('No Data Returned');}
}

You'll need to use an interstitial XMLHTTP object:

var req = new ActiveXObject("MSXML2.XMLHTTP");
req.Open("GET", jsvProtocolServer, false);
req.setRequestHeader("content-type", "text/xml");
req.Send();
objRecordset.Open(req.responseXML); // connection string is
superfluous

We have code running that downloads persistence provider XML from an HTTPS
site many thousands of times daily, but if you have any difficulties, a big
advantage is that the XMLHTTP object will download whatever is there,
regardless of validity in any context, giving you the opportunity to look at
the content while debugging. (Conversely, a recordset object is pretty much
a black box, if its XML structure requirements are not met.)


-Mark



.



Relevant Pages

  • Data view problems in FP 2003
    ... I tried using XML but i do not want to copy the XML file to "my ... MSAaccess file on disk and have it read that instead. ... I tried using the configure OLEDB connection string option to do this ... The web server cannot connect to specified data source because the ...
    (microsoft.public.sharepoint.portalserver)
  • data view problems in FP 2003
    ... I tried using XML but i do not want to copy the XML file to "my ... MSAaccess file on disk and have it read that instead. ... I tried using the configure OLEDB connection string option to do this ... The web server cannot connect to specified data source because the ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Error extracting innerHTML using DHTML in an HTA page
    ... I will look at using the XMLHTTP object. ... on the Server side is the result of a rather complex FOR XML EXPLICIT SQL ... > Use the XMLHTTP object to request the xml from the server-side asp ...
    (microsoft.public.scripting.vbscript)
  • Re: Problem with xmlhttp
    ... I guess I had the problem bcos I did not quite understand the sample code. ... "Tony Proctor" wrote: ... I did not use xml. ... If you only want to access a specific URL then the xmlhttp object isn't ...
    (microsoft.public.vb.com)
  • Re: connection string variable...
    ... We are looking at setting up a backup SQL server. ... I would like to modify the .xml config files so that they read the connection string from a network share instead. ... You create a function that opens that file and reads the string data from connstr.txt. ...
    (microsoft.public.dotnet.languages.vb)