How to get XML from SQL Server
From: R. Daneel Olivaw (nomail)
Date: 03/29/04
- Next message: Shayler Rychlick: "Counting groups of Date Ranges"
- Previous message: mike calcagno: "Delph7 + ADO conenction to advantage & oracle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Mar 2004 16:29:45 +0200
Hi all
I have this simple query:
SELECT field0, ..., fieldN FROM mytable where [...] FOR XML AUTO
I use a TAdoQuery to get back result, and I get only a field with a blob
field that holds the XML.
Now I want to read the contents of the blob field, and I use
something like that
fileStream := TFileStream.Create('c:\tmp\test.xml', fmOpenReadWrite);
adoStream := TAdoBlobStream.Create(tableview.Fields[0] as TBlobField,
bmRead);
fileStream.CopyFrom(adoStream, 0);
fileStream.Free;
adoStream.Free;
The code works but in the test.xml file I see a lot of strange characters :
This is how appears in the Microsoft Query Analyzer
<clusters clusterid="60689" reelid="0120040331"><spots ...
This is how appears in the test.xml file
D
c l u s t e r _ i d Dr e e l _ i d Ds p o t _ p o
Any Idea ?
- Next message: Shayler Rychlick: "Counting groups of Date Ranges"
- Previous message: mike calcagno: "Delph7 + ADO conenction to advantage & oracle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|