Article View: borland.public.cppbuilder.database.ado
Article #1287Re: Storing images from IStream based object into MSSQL through ADO
From: Brad Arant
Date: Tue, 14 Sep 2004 17:32
Date: Tue, 14 Sep 2004 17:32
56 lines
2979 bytes
2979 bytes
Thank You - Will try it. Much appreciiated -
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:4146b322@newsgroups.borland.com...
> It seems that easest way for you is to use native ADO objects. In IDE menu
> select "Project\Import type library" and import
> "Microsoft ActiveX Data Objects 2.X Library". You will have classes to
work
> with ADO.
>
> The code for BCB ADO objects is:
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
> ADOConnection1->ConnectionString = WideString("Provider=SQLOLEDB;"
> "Integrated Security=SSPI;Initial Catalog=XXX;");
> ADOConnection1->Connected = true;
>
> ADOCommand1->Connection = ADOConnection1;
> ADOCommand1->CommandText = WideString("INSERT INTO ImageTest (ImgColumn)
> VALUES (?)");
>
> ADOCommand1->Parameters->Refresh();
>
>
ADOCommand1->Parameters->Items[0]->LoadFromFile(ExtractFilePath(ParamStr(0))
> + "img.jpg", ftBlob);
> ADOCommand1->Execute();
> }
>
> //------------------------------------------
> 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)
>
> "Brad Arant" <barant@barant.com> �������/�������� � �������� ���������:
> news:41460f24$1@newsgroups.borland.com...
> > I have many examples of using a recordset to store an image into MSSQL
> using
> > a CRecordset object but I am trying to do this using BCB6.
> >
> > The question is what is the best way to do this and is there any code
> > examples anywhere that can help me? I have done this successfully in
VC++
> > using the ADO.Stream object but for the life of me I can't figure out
the
> > details in BCB using the TADO objects.
> >
> >
> >
> >
> >
>
>
Technical Details
Message-ID:
<41472ad0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41460f24$1@newsgroups.borland.com> <4146b322@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9b4a015d247fa72d X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII Reply-To: "Brad Arant" <barant@barant.com> From: "Brad Arant" <barant@barant.com> Newsgroups: borland.public.cppbuilder.database.ado References: <41460f24$1@newsgroups.borland.com> <4146b322@newsgroups.borland.com> Subject: Re: Storing images from IStream based object into MSSQL through ADO Date: Tue, 14 Sep 2004 10:32:22 -0700 Lines: 58 Organization: BARANT Technologies 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: 66.12.94.132 Message-ID: <41472ad0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1095183056 66.12.94.132 (14 Sep 2004 10:30:56 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail