Solved

read to MSXML object from blob

Posted on 2009-03-30
2
480 Views
Last Modified: 2012-05-06
This should be a simple process. Yet I've checked over 500 web sites in the last two hours and still have not seen one page that explains how this is done.  I am querying a BLOB field from an Oracle Database that contains an XML file.  I want to read the contents of the BLOB to the an XML object held in memory that will then be parsed using one of the MSXML objects.  This must be done in classic ASP.  It is obvious that you create a recordset that includes the blob field.  The next steps are unclear.  Can you read the rs field contents directly to one of the objects in the MSXML object model, if so which object using which method.  Or is it necessary to read the rs field to an object that has been server created as ado stream object which the msxmml object will then load. Again what object and method would be used for this?  I don't know why I can't find a reference to this object library (MSXML2) anywhere, with advice on what object to use in what circumstances.  In the project I am updating I have seen used DOMDocument, ServerXMLHTTP,  XMLHTTP and they all seem to do the same thing; store an XML document in memory.  
0
Comment
Question by:Edward Joell
  • 2
2 Comments
 

Author Comment

by:Edward Joell
ID: 24029025
According to http://support.microsoft.com/kb/283164/en-us,  about the problem "If you attempt to run the Load method of an MSXML DOMDocument object by supplying an ActiveX Data Object (ADO) 2.5 Stream object that contains valid XML data as the xmlSource parameter, the following error message is generated: 'Run-time error '5': Invalid procedure call or argument '"
"If you upgrade to MDAC 2.6, the problem does not occur when you supply an ADO 2.6 Stream object as the xmlSource parameter for the Load method of an MSXML DOMDocument object. The ADO 2.6 Stream object is internally queryable for the IStream interface."  

This would seem to indicate that you could
Set XMLStream = Server.CreateObject("ADODB.Stream")
Then after initializing
Set oXMLDoc = Server.CreateObject("MSXML2.DOMDocument")
you could
oXMLDoc.Load XMLStream

Of course the question remains can you;
Set XMLStream = rsXMLBLOB("BlobField")

If this is the case then everything is solved.  

I will now experiment with this.
0
 

Accepted Solution

by:
Edward Joell earned 0 total points
ID: 24032551
No first you set  create the stream then open it set its type to be binary (enum = 1) Then you
set XMLStream = Server.CreateObject("ADODB.Stream")
XMLStream.Open
XMLStream.Type = 1
XMLStream.Write RS("BlobField")
XMLStream.Position = 0
Set oXMLDoc = Server.CreateObject("MSXML2.DOMDocument")
oXMLDoc.validateOnParse = True
oXMLDoc.async = False
oXMLDoc.Load XMLStream
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question