Article View: borland.public.cppbuilder.database.ado
Article #2085Re: Need to store and retrieve a file (any kind) into and from a ADO DB
From: Viatcheslav V. Vassiliev
Date: Mon, 03 Nov 2003 06:53
Date: Mon, 03 Nov 2003 06:53
97 lines
3911 bytes
3911 bytes
MS Access uses its own format to store OLE object - it stores class information too. In case of bitmap the real bmp starts at offset 78. Stream->Seek(78, soFromBeginning); //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com http://www.oledbdirect.com "Alen Markov" <NOSPAM_amarkov@gmx.net> �������/�������� � �������� ���������: news:3fa57725$1@newsgroups.borland.com... > Hello Paolo > > I'm working on exactly the same. > I have an Access File and want to store pictures into it. > I think we are right to use OLEObject in the Access Table, because if you > use > a DBGrid and access the Access-Table with ADO (and don't set specific > columns to be shown > in the DBGrid - so the DBGrid shows all columns by default), the colum > holding OLEObject > will display "BLOB" (Binary Large OBject - which should be the right one). > > To fill that field with BCB5, I took a DBImage-Component from the "Data > Controls" page. > > I have this settings for my component DBImage1: > > DataSource: DataSource1 > DataField: Picture (<- This is the Access Column OLEObject) > > DataSource1 has as DataSet: ADOQuery1 > > And ADOQuery1 has a ConnectionString where I access through > "Microsoft Jet 4.0 OLE DB Provider" the *.mdb-File > > > Now what I don't get is: > They write to add a picture into DBImage, you can work with > "Copy'n'paste"... > > The only way I found out to add a picture to that DBImage is like this: > Open MSPaint, load a Bitmap picture. Press CTRL-A (to select the whole > picture). Press CTRL-C (to copy the selection) - then click on that > DBImage and press CTRL-V to paste the picture into the DBImage component... > > That will save the picture into the Access Database and also work like this > > But: Isn't there any other more easy way to fill DBImage with a picture? > > I tryed this: > OpenPictureDialog1->execute(); > DBImage1->Picture->LoadFromFile(OpenPictureDialog1->FileName); > > The result is: The picture is really displayed in my DBImage1-Component now, > but if you click on another Row in the DBGrid and then click back on the > row where you "inserted" the picture with "LoadFromFile" - it's not beeing > displayed anymore :-/ > > Anybody with a useful hint here? > > > Best regards, > Alen > > -- > WEB: http://www.come.to/nostromo > > > > "Paolo Borlandi" <pborlandi@virgilio.it> wrote in message > news:3f799037@newsgroups.borland.com... > > I need to store files (any kind) into a db record and retrive it when > asked. > > The db is a Ms Access db. > > > > the field tyte is OLEObject (right?? wrong??) > > > > Have someone some idea or example?? > > > > THANK YOU VERY MUCH > > > > Paolo from Italy > > > > > > > > > > > > > >
Technical Details
Message-ID:
<3fa5fbbb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f799037@newsgroups.borland.com> <3fa57725$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,78f7fca98722ead5 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-11-02 23:09:03 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3f799037@newsgroups.borland.com> <3fa57725$1@newsgroups.borland.com> Subject: Re: Need to store and retrieve a file (any kind) into and from a ADO DB Date: Mon, 3 Nov 2003 09:53:56 +0300 Lines: 99 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 213.234.218.42 Message-ID: <3fa5fbbb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1067842491 213.234.218.42 (2 Nov 2003 22:54:51 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail