🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CreateBlobStream

#1730
From: Mike Crapo
Date: Tue, 20 Apr 2004 21:27
35 lines
2064 bytes
Kev.

Here is some code on how I get a blob out of a database.  It has been
changed to make it more generalized, but you should be able to see the
meathods.

//Connect to database
TADOQuery *Query = new TADOQuery(0);
TADOBlobStream *Stream;
Query->SQL->Add("SELECT TraceDetails FROM TraceTable Where TraceID =
1");
Query->Connection = ADOConnection; //Or whatever you ado connection
is.
Query->CursorType = ctStatic;
Query->CacheSize = 10000;
Query->CursorLocation = clUseClient;
Query->LockType = ltReadOnly;
Query->Open();
if(Query->RecordCount > 0)
  {
  Stream = new
TADOBlobStream((TBlobField*)Query->Fields->Fields[0],bmRead);
  Stream->Position = 0;
  Stream->SaveToFile("Test.tmp");//Do whatever you want to do with the
stream.
  delete Stream; //Delete Stream before closing conection
  }
delete Query;


Mike

On Tue, 20 Apr 2004 15:17:35 -0500, "kdl" <me@isp.net> wrote:

>TraceDetails
Technical Details
Message-ID: <va5b805kaktfpiju4sredkjm88tdgcb5ei@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!wn13feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!stdio!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4083e397@newsgroups.borland.com> <4084f3da$1@newsgroups.borland.com> <4085340d@newsgroups.borland.com> <40854a43$1@newsgroups.borland.com> <40858559$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,eb986792cae970be
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-04-20 14:31:03 PST
From: Mike Crapo <>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: CreateBlobStream
Date: Tue, 20 Apr 2004 16:27:11 -0500
Message-ID: <va5b805kaktfpiju4sredkjm88tdgcb5ei@4ax.com>
References: <4083e397@newsgroups.borland.com> <4084f3da$1@newsgroups.borland.com> <4085340d@newsgroups.borland.com> <40854a43$1@newsgroups.borland.com> <40858559$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.178.101.226
X-Trace: newsgroups.borland.com 1082496429 208.178.101.226 (20 Apr 2004 14:27:09 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!wn13feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!stdio!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail