Board index » delphi » converting ADORecordset to XML

converting ADORecordset to XML

trying to get a TADOQuery's Recordset information in XML format, however I
do not want to persist to disk the data but rather simply get it as a
string/stream. ADOExpress has the function SaveToFile but takes WIDESTRING
as the parameter. It's imported _Recordset object also only takes
WIDESTRING so I cannot easily get the XML of an ADORecordset.

For example, I'd like to do something like this:

var
  tempString : String;
begin
  ADOQuery1.Open;  { predefined query object }
  ADOQuery1.Save(tempString, adPersistXML);
  ShowMessage(tempString);
end;

Is there nothing like this available in the current ADOExpress? Will I have
to import another copy of the MS ADO Library?

-BKN

 

Re:converting ADORecordset to XML


Quote
> trying to get a TADOQuery's Recordset information in XML format, however I
> do not want to persist to disk the data but rather simply get it as a
> string/stream.

Here is an example:
http://web.orbitel.bg/vassil/TBetterADODataSet_Interface.htm#SaveToAD...

HTH
--
Vassil Nazarov
IT Manager, Sofia Cable SA

Re:converting ADORecordset to XML


I actually figured out what the problem was. Delphi 5's (I think)
ADOExpress implements ADO 2.1 which doesn't support in-memory persisting of
XML. I imported the 2.5 TLB and am now able to save to an OLEVariant
instead of a WideString.

I DID have a question on how to handle the OleVariant and Streaming stuff,
but your example helped me there, so thanks :)

-BKN

Quote
"Vassil Nazarov" <vas...@mail.orbitel.bg> wrote in message

news:3aff47eb_1@dnews...
Quote
> > trying to get a TADOQuery's Recordset information in XML format,
however I
> > do not want to persist to disk the data but rather simply get it as a
> > string/stream.

> Here is an example:

http://web.orbitel.bg/vassil/TBetterADODataSet_Interface.htm#SaveToAD...
m
Quote

> HTH
> --
> Vassil Nazarov
> IT Manager, Sofia Cable SA

Other Threads