🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Please Help - Retrieveing Image from Database with ADO

#2096
From: Mike Crapo
Date: Tue, 04 Nov 2003 15:48
62 lines
2874 bytes
OK - The plot thickens.

I found that with the new applicaton I had the Build with runtime
packages checked and Use Dynamic RTL checked.  Since I want this to be
a stand alone app, I unchecked them and guess what, it started giving
me correct size of file, and I was able to retrieve the image from the
database.

But the problem with installing service pack 4 for BCB 6 is still
there.  If I install this service pack, even with the app setup to be
stand along, it quits working correctly.  

Any suggestions on what is happening?

Thanks
Mike

On Tue, 04 Nov 2003 09:09:06 -0600, Mike Crapo <> wrote:

>Hello.
>
>I have this code that I have written for retrieving a graphic from the
>database.
>
>//Connected to database
>TADOQuery *Query = new TADOQuery(0);
>TADOBlobStream *Stream;
>Query->SQL->Add("SELECT Image FROM tbImage WHERE ImgID = 31");
>Query->Connection = ADOConnection;
>Query->CursorType = ctStatic;
>Query->CacheSize = 10000;
>Query->CursorLocation = clUseClient;
>Query->LockType = ltReadOnly;
>Query->Open();
>if(Query->RecordCount > 0)
>  {
>  Query->First();
>  TADOBlobStream((TBlobField*)Query->Fields->Fields[0],bmRead);
>  Stream->Position = 0;
>  //Work with graphic
>  delete Stream;
>   }
>delete Query;
>//DisConnect database
>
>The database is Access using the 2002 format.
>
>I have this code work ok in one project, but when I copy and pasted it
>into another project it does not work.  
>
>Here is the wierd part.  In the project when the code works, if you
>look at the Stream->Size it is equal to 541881.  In the project where
>it does not work if you look at the same size it is alway equal to 4.
>
>Also if I load borlands service pack 4 the code in the application
>that did work, quits working, it now only returns a Stream->Size = 4.
>
>
>Can anyone tell me what I am doing wrong, and how to fix it please.
>
>Thank You Very Much.
>Michael Crapo
Technical Details
Message-ID: <sdifqvgvq3msj4776sn1bl6rj07iecom5i@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <htffqv8671rgj79ss1ak1rhqfgsgkr4mk0@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,a072fa01fe6a770e
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-04 08:10:50 PST
From: Mike Crapo <>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Please Help - Retrieveing Image from Database with ADO
Date: Tue, 04 Nov 2003 09:48:55 -0600
Message-ID: <sdifqvgvq3msj4776sn1bl6rj07iecom5i@4ax.com>
References: <htffqv8671rgj79ss1ak1rhqfgsgkr4mk0@4ax.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 1067961136 208.178.101.226 (4 Nov 2003 07:52:16 -0700)
Lines: 63
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail