Re: MDAC Converting Dataset to XML



I hadn't realised there was a later version of MDAC than the one we had
2.82.1830 though you look like you are using 2003 Web Server edition whereas
I am using 2003 Standard Edition SP1. It kinda annoys me that there are
different versions of DLL's for the same product version i.e. MDAC 2.8
dependant on the OS - I'm sure there's a good reason but it does complicate
life.

OK, starting with valid XML (i.e. listing 1) and converting that to a
recordset is fine, the code that does this is a mirror of the conversion to
XML (as you would expect) and for completeness I include a copy (albeit
Delphi):

RS := CreateOleObject('ADODB.Recordset');
if XML = '' then
Exit;

Stream := TStringStream.Create(XML);
try
Stream.Position := 0;
RS.Open(TStreamAdapter.Create(Stream) as IUnknown);
aRecordSet.RecordSet := _RecordSet(IUnknown(RS));// as TADODataSet;
finally
Stream.Free;
end;

This then seems to isolate the issue to converting from recordset to XML for
2.82.1830 (i.e. WIN2003 SP1 MDAC 2.8).

In verifying that the recordset returned PRIOR and POST conversion to XML I
output the data to a plain text file and the values are fine (which is the
reason I ruled out the driver). I can also confirm that ADTG is fine in this
instance.

I will try to replicate in Delphi the code you have provided but the
language barrier may cause me a problem.

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"



.



Relevant Pages

  • Re: Persisted XML files cannot be opened...
    ... which ships with MDAC to see if MDAC is not corrupted on this PC. ... > The first statement plucks an ADO recordset, stored as an XML fragment, ... The error message points to a problem in the ...
    (microsoft.public.vb.com)
  • Re: Persisted XML files cannot be opened...
    ... which ships with MDAC to see if MDAC is not corrupted on this PC. ... > The first statement plucks an ADO recordset, stored as an XML fragment, ... The error message points to a problem in the ...
    (microsoft.public.data.ado)
  • Re: Persisted XML files cannot be opened...
    ... which ships with MDAC to see if MDAC is not corrupted on this PC. ... > The first statement plucks an ADO recordset, stored as an XML fragment, ... The error message points to a problem in the ...
    (microsoft.public.vb.winapi)
  • Re: Persisted XML files cannot be opened...
    ... What I would suggest to do is to run ComponentChecker ... which ships with MDAC to see if MDAC is not corrupted on this PC. ... >> The first statement plucks an ADO recordset, stored as an XML fragment, ...
    (microsoft.public.vb.winapi)
  • Re: Persisted XML files cannot be opened...
    ... What I would suggest to do is to run ComponentChecker ... which ships with MDAC to see if MDAC is not corrupted on this PC. ... >> The first statement plucks an ADO recordset, stored as an XML fragment, ...
    (microsoft.public.vb.com)