Article View: borland.public.cppbuilder.database.ado
Article #2056Re: Accessing a Cell of an Access Table directly by code with ADO
From: Alen Markov
Date: Wed, 26 Nov 2003 10:48
Date: Wed, 26 Nov 2003 10:48
53 lines
2265 bytes
2265 bytes
Heya,
that's (nearly) exactly what I was looking for! =D
The correct Syntax is:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if( OpenPictureDialog1->Execute() )
{
Image1->Picture->LoadFromFile(OpenPictureDialog1->FileName);
DBEdit1->Text = OpenPictureDialog1->FileName;
ADOQuery1->Edit();
ADOQuery1->FieldByName("Path")->AsString =
OpenPictureDialog1->FileName;
}
}
Thanks a lot!
Alen
--
WEB: http://www.come.to/nostromo
"dcent" <DcentJ8@NetScape.net> wrote in message
news:3FC4238B.1070107@NetScape.net...
> Alen Markov wrote:
> > I tryed it with a DBEdit - I connected that one with the DataField
"Path".
> > If I write directly by Hand into that DBEdit and then press the tab-key,
> > the value I entered is directly stored into the mdb-File in the column
Path
> > for the appropriate row...
> >
> > First thought was - great, that's it... So I just added this simple
code:
> >
> > OpenPictureDialog1->Execute();
> > DBEdit1->Text = OpenPictureDialog1->FileName;
> >
> > But this doesn't STORE the value (Path) into the mdb-File :-/
> >
> > (as soon as I click with the mouse into that DBEdit1, the path is gone
> > again...)
> >
> Assign OpenPictureDialog1->FilName to the underlying field in the
> ADOQuery->FieldByName{"FieldName"]->AsString (Syntax?)
>
> dcent
>
Technical Details
Message-ID:
<3fc4847b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fc26387@newsgroups.borland.com> <3FC4238B.1070107@NetScape.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,b1bab58e749cc854 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-11-26 03:09:15 PST From: "Alen Markov" <NOSPAM_amarkov@gmx.net> Newsgroups: borland.public.cppbuilder.database.ado References: <3fc26387@newsgroups.borland.com> <3FC4238B.1070107@NetScape.net> Subject: Re: Accessing a Cell of an Access Table directly by code with ADO Date: Wed, 26 Nov 2003 11:48:07 +0100 Lines: 55 X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.162.156.2 Message-ID: <3fc4847b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069843579 217.162.156.2 (26 Nov 2003 02:46:19 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail