🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1121

for xml auto clause under MSSQL

#1121
From: Tharun Pillay
Date: Sun, 09 Jan 2005 10:45
30 lines
1892 bytes
Hello all,

Tried posting this on the XML group - don't think that was appropriate now 
that I see this group exists. Anyways...

Been browsing around all day for a code sample or information on how to
retrieve data from MS SQL Server 2000 using the "for xml clause" via ADO
(using the standard ODBC drivers) into a BCB app. It seems to come through
all garbled in the blob field.

Saw some delphi code and tried porting it with no real luck. Looked
something like this:

1    OleVariant v = (AnsiString)"Output Stream";
2   OleVariant v2;
3
4    adocmdMain->CommandText = "select * from products for xml auto"
5    adocmdMain->Connection = ADOConnection1;
6    adocmdMain->Properties->Item[v]->Set_Value (v2);
7
8    adocmdMain->Execute();
9    Memo1->Lines->Text = v2.AsType(varOleStr);


Line 6 thows an exception the first time click the button, thgouh after that
its fine - I can sort of understand why.

*sigh* Please could someone help me out. Thanks a mil!
.T
Technical Details
Message-ID: <41e10b6b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,d88f580cafc5475f,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Tharun Pillay" <tharun@webmail.co.za>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: for xml auto clause under MSSQL
Date: Sun, 9 Jan 2005 12:45:59 +0200
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 155.239.217.107
Message-ID: <41e10b6b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1105267563 155.239.217.107 (9 Jan 2005 02:46:03 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail