🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Blob data

#1533
From: Scott Elgram
Date: Fri, 07 May 2004 18:04
71 lines
2968 bytes
Thanks for that but I accomplished the task with

ADOQuery1->SQL->Text = "SELECT TOP 1 * FROM Test";
ADOQuery1->Open();
ADOQuery1->Insert();
TBlobField *BlobField = dynamic_cast <TBlobField*>
(ADOQuery1->FieldByName("Image"));
BlobField->LoadFromFile(ImageFile);
ADOQuery1->Post();
ADOQuery1->Close();

-Scott


"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:40993d7a$1@newsgroups.borland.com...
> Code is not tested but it should look like this:
>
> TFileStream * Blob = new TFileStream(ImageFile, fmOpenRead);
> try
> {
>  ADOQuery1->SQL->Text = "SELECT * FROM ImgQueue";
>  ADOQuery1->Open();
>  ADOQuery1->Inert();
>  ((TBlobField*)ADOQuery1->FieldByName("Image"))->LoadFromStream(Blob);
>  ADOQuery1->Post();
>  ADOQuery1->Close();
> }
> __finally
> {
>  delete Blob;
> }
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
> "Scott Elgram" <SElgram@verifpoint.com> �������/�������� � ��������
> ���������: news:4092e332$1@newsgroups.borland.com...
> > Hello,
> >     I am in need to stream TIF images into a MS SQL database.  I am
using
> > BCB6 and am more familiar with ADO then any of the other DB components
> > offered.  I know in Delph 7 the code to do this is;
> >
> > -------------Begin Delphi Code---------------
> > Blob := TFileStream.Create(ImageFile, fmOpenRead);
> >   With ADOQuery1 do
> >       begin
> >           SQL.Text := 'SELECT * From ImgQueue';
> >           Open;
> >           Insert;
> >           (FieldByName('Image') AS TBlobField).loadfromStream(Blob);
> >           Post;
> >           Close;
> >       end;
> > --------------End Delphi Code--------------
> >
> > Can anyone tell me how I can accomplished this in C++?
> >
> > thanks,
> > -- 
> > -Scott Elgram
> >
> >
>
>
Technical Details
Message-ID: <409bcfaa$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-mail
References: <4092e332$1@newsgroups.borland.com> <40993d7a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,ff68206e3ae6c5cb
X-Google-Attributes: gid10698b,public
From: "Scott Elgram" <SElgram@verifpoint.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4092e332$1@newsgroups.borland.com> <40993d7a$1@newsgroups.borland.com>
Subject: Re: Blob data
Date: Fri, 7 May 2004 11:04:28 -0700
Lines: 73
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: 63.65.31.240
Message-ID: <409bcfaa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083953066 63.65.31.240 (7 May 2004 11:04:26 -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