Re: Opening XML file over HTTPS with ADODB on a web page.
- From: "Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Wed, 22 Feb 2006 09:13:16 -0800
"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
.
- Prev by Date: Re: MDAC 2.7 with Win XP SP2
- Next by Date: Re: Limiting session pool size
- Previous by thread: MDAC 2.7 with Win XP SP2
- Next by thread: ADOX and text
- Index(es):
Relevant Pages
|
|