Solved

read to MSXML object from blob

Posted on 2009-03-30
2
486 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
[X]
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
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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