Solved

read to MSXML object from blob

Posted on 2009-03-30
2
479 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now