Solved

read to MSXML object from blob

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

13 Experts available now in Live!

Get 1:1 Help Now