Article View: borland.public.cppbuilder.database.ado
Article #1608Re: ADO - Access - Images
From: Zannha
Date: Mon, 31 May 2004 22:15
Date: Mon, 31 May 2004 22:15
33 lines
2183 bytes
2183 bytes
More blob questions :-)
I found this code by Viatcheslav in another post:
TFileStream * Blob = new TFileStream(Form1->Open->FileName, fmOpenRead);
try
{
Form1->query->SQL->Text = "SELECT * FROM map";
Form1->query->Open();
Form1->query->Insert();
((TBlobField*)Form1->query->FieldByName("map"))->LoadFromStream(Blob);
Form1->query->Post();
Form1->query->Close();
}
__finally
{
delete Blob;
}
This works fine, but, it seems to be inserting the image data into a new
row, how can I make it go in a row "WHERE ID = 1" for instance?
Second, when taking the image back out from the database, how would I do
that? Is it just a matter of using SaveToStream instead? An example would be
great.
Third, i'm inserting PNG images with transparent values, and I though I read
somewhere that access databases convert images to bitmaps, is this still
true when it reads LONG BINARY in the field? Shouldn't the image be the same
when taken out as when putting it in?
In advance thanks!
Technical Details
Message-ID:
<40bbae99$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40b92b3f$1@newsgroups.borland.com> <40b99cf2$2@newsgroups.borland.com> <40b9c366@newsgroups.borland.com> <40b9c6b4$1@newsgroups.borland.com> <40b9c91d$1@newsgroups.borland.com> <40b9fd17@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,6d0993f8aff78e0a X-Google-Attributes: gid10698b,public From: "Zannha" <asd> Newsgroups: borland.public.cppbuilder.database.ado References: <40b92b3f$1@newsgroups.borland.com> <40b99cf2$2@newsgroups.borland.com> <40b9c366@newsgroups.borland.com> <40b9c6b4$1@newsgroups.borland.com> <40b9c91d$1@newsgroups.borland.com> <40b9fd17@newsgroups.borland.com> Subject: Re: ADO - Access - Images Date: Tue, 1 Jun 2004 00:15:57 +0200 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 83.109.44.214 Message-ID: <40bbae99$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1086041753 83.109.44.214 (31 May 2004 15:15:53 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail