Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

read to MSXML object from blob

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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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