🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Saving Image to Access Database

#394
From: Michael Corby
Date: Wed, 11 Oct 2006 17:17
51 lines
2211 bytes
Have solved this problem with help from Thomas Maeder.

Thanks, Thomas.

Michael Corby


"Michael Corby" <mcorby@indigo.ie> wrote in message 
news:452bb718@newsgroups.borland.com...
> Hi
>
> I am trying to save images to an OLE Object field in Microsoft Access
> with the following code, but i am getting a couple of compile errors :-
>
> Could not find match for BlobField
> LoadFromStream is not a member etc - I think this is because of the first 
> message
>
> Code as follows :-
>
>   String pictureName;
>   TMemoryStream *stream = new TMemoryStream;
>   TBlobField *field = new TBlobField;
>
>   pictureName = "C:\\MC\\Images\\Tulips.jpg";
>
>   stream->LoadFromFile(pictureName);
>
>   field = dynamic_cast<TBlobField *>
>           (wDataModule->tPlants->FieldByName("JPGImage"));  // OLE Object 
> field in Database
>
>   wDataModule->tPlants->Edit();
>
> //   wDataModule->tPlants->FieldByName("JPGImage")->    // commented out
> //               LoadFromStream(stream.get(), ftGraphic);            // 
> commented out
>
>   field->LoadFromStream(stream.get(), ftGraphic);
>
>   wDataModule->tPlants->Post();
>
>   delete stream;
>   delete field;
>
>
>
> Any help appreciated
>
> Michael Corby
> 
Technical Details
Message-ID: <452d2740$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <452bb718@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,f1e6d54834bdceb1
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Michael Corby" <mcorby@indigo.ie>
Newsgroups: borland.public.cppbuilder.database.ado
References: <452bb718@newsgroups.borland.com>
Subject: Re: Saving Image to Access Database
Date: Wed, 11 Oct 2006 18:17:51 +0100
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: 83.71.100.3
Message-ID: <452d2740$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160587072 83.71.100.3 (11 Oct 2006 10:17:52 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail