🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

C++ Builder 6 w/ADO and SQL2000 using the "FOR XML EXPLICIT" in a SP to generate XML

#3398
From: Tim Martin
Date: Thu, 12 Sep 2002 12:32
31 lines
2129 bytes
Is there anyone out there who can help in showing me how to return the BLOB
that is generated by using the "FOR XML EXPLICIT" within an Stored
Procedure.  I am using the TADOStoredProcedure object to call the SP and
return the result.  The Field name is returned okay and even the size
appears correct but I cannot get the text.  I found a couple of examples of
how to retrieve images but I can not get them to work.  Also I used the
"CreateBlobStream()" method and still was unsuccessful.  When I run the
query in QueryAnalzer it returns the correct data.  The ADO book suggests
assigning a stream to the "Output Stream" property of a Command object and
then accessing the stream.  Does anyone have experience with doing this and
can provide a clue to what I am missing?

Current code looks like...

String strTemp;

TStream *pBlob = ADOSP_GetOptions->CreateBlobStream(
ADOSP_GetOptions->Fields->Fields[0],bmRead);

char *szBuf = malloc( pBlob->Size );

int iSize = pBlob->Read( szBuf,pBlob->Size );

strTemp = AnsiString( szBuf,iSize );

delete pBlob;
free( szBuf );

Thanks,

Tim
Technical Details
Message-ID: <3d808961$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,bdaea7592131e271,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-09-12 05:42:43 PST
From: "Tim Martin" <tmartin@commandalkon.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: C++ Builder 6 w/ADO and SQL2000 using the "FOR XML EXPLICIT" in a SP to generate XML 
Date: Thu, 12 Sep 2002 08:32:17 -0400
Lines: 33
Organization: Command Alkon Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
NNTP-Posting-Host: 12.109.108.147
Message-ID: <3d808961$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1031833953 12.109.108.147 (12 Sep 2002 05:32:33 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail