Re: MDAC Converting Dataset to XML
- From: Stewart (Oraculum) <StewartOraculum@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 7 Aug 2007 06:08:06 -0700
OK, I think I have reproduced your code in Delphi as follows:
if Recordset = nil then Exit;
try
RS := CreateOleObject('ADODB.Recordset');
RS := Recordset.Recordset;
xmlobj := CreateOleObject('MSXML2.DomDocument');
if Form2.RadioButton1.Checked then
RS.Save(xmlobj, pfXML)
else
RS.Save(xmlobj, pfADTG);
Result := xmlobj.xml;
finally
Stream.Free;
RS := UNASSIGNED;
end;
As you see didn't require too much change and the results are the same,
however trying this method via ADTG fails but I think I would expect that
seeing as its using an XML object explicitly.
Stewart
"Bob Barrows [MVP]" wrote:
Stewart (Oraculum) wrote:.
The generated XML for a "working" instance is as follows:
Notice that the 20 and 100 have changed to 0.
The ADO recordset is constant throughout and has the right values.
I believe that the VB equivalent of what I am trying to achieve can
be found in the following article 252767:
http://support.microsoft.com/kb/252767
Can you reproduce the symptom by saving the first piece of xml to a file,
opening the recordset on the file, and saving it to another xml document?
Assuming that to be the case, I've just tried to reproduce this on a W2003
web server that has 2.82.3959.0 installed using this code (that kb article
jumps through a few needless hoops):
<%
dim rs,xmldoc,xmldoc2
set xmldoc=createobject("msxml2.domdocument")
xmldoc.load server.MapPath( "rstestsrc.xml")
set rs=createobject("adodb.recordset")
rs.Open xmldoc
Response.Write rs.Fields.count & "<BR><BR>"
Response.Write rs.GetString(,," | ","<BR>")
Response.Write "<BR>"
set xmldoc2=createobject("msxml2.domdocument")
rs.close
rs.Open xmldoc
rs.Save xmldoc2,adPersistXML
Response.Write xmldoc2.xml
%>
The above code fails to produce your symptom so:
If you can reproduce the symptom using the Delphi equivalent of the above,
then:
1. My MDAC version is later than yours, so my first suggestion is to get the
latest version of MDAC and see if that fixes your problem. If it does not
fix your problem, then either the database or Delphi has to be involved in
the problem
If you cannot reproduce the symptom using the above technique, then the
database has to be involved somehow, and I will be unable to help, given
that I have no access to an Oracle database. I would suggest using GetString
or looping through the recordset to verify that the recordset actually
contains what you think it contains. Given that you say it works well with
PersistADTG, I would suspect that this would be a little bit of wasted time,
but one has to cover all the bases
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
- Follow-Ups:
- Re: MDAC Converting Dataset to XML
- From: Bob Barrows [MVP]
- Re: MDAC Converting Dataset to XML
- References:
- Re: MDAC Converting Dataset to XML
- From: Bob Barrows [MVP]
- Re: MDAC Converting Dataset to XML
- From: Bob Barrows [MVP]
- Re: MDAC Converting Dataset to XML
- From: Bob Barrows [MVP]
- Re: MDAC Converting Dataset to XML
- From: Stewart (Oraculum)
- Re: MDAC Converting Dataset to XML
- From: Bob Barrows [MVP]
- Re: MDAC Converting Dataset to XML
- Prev by Date: Re: MDAC Converting Dataset to XML
- Next by Date: Re: MDAC Converting Dataset to XML
- Previous by thread: Re: MDAC Converting Dataset to XML
- Next by thread: Re: MDAC Converting Dataset to XML
- Index(es):
Loading