Article View: borland.public.cppbuilder.database.ado
Article #5747Re: Getting DateTime Field from MSACCESS
From: Bruce Lecus
Date: Sat, 03 Mar 2001 13:17
Date: Sat, 03 Mar 2001 13:17
82 lines
3096 bytes
3096 bytes
Koert,
Not sure why you would receive an E2288 error. Which pointer does he have a
problem with?
Also, instead of a WORD, I put my dates into a TDateTime field and then decode.
Bruce.
Koert Wilmink wrote:
> Hi Bruce,
>
> I received the following error:
>
> [C++ Error] Unit1.cpp(251): E2015 Ambiguity between '_fastcall
> System::TDateTime::operator =(const System::TDateTime &)' and '_fastcall
> System::TDateTime::operator =(const double)'
>
> I did try your solution too ( Try ADOQuery1->FieldByName("Dag")->AsDateTime)
> , I received the next error:
> [C++ Error] Unit1.cpp(251): E2288 Pointer to structure required on left side
> of -> or ->*
>
> Thanks for your help!!
>
> Best regards
>
> Koert Wilmink
>
> "Bruce Lecus" <bwlecus@intrex.net> wrote in message
> news:3A99B19D.6EC538D2@intrex.net...
> > Koert,
> >
> > What is the error message?
> >
> > Try ADOQuery1->FieldByName("Dag")->AsDateTime
> >
> > Bruce.
> >
> > Koert Wilmink wrote:
> >
> > > Hi all,
> > >
> > > I have a MSACCESS database with a table called "Dag" with a field called
> > > "Dag" with type Date.
> > > I want to decode this date field, thirst I'm assigning this field to
> Gdate,
> > > GDate = ADOQuery1->FieldValues["Dag"];
> > >
> > > The compiler is giving me an error! What is wrong ????? See the
> following
> > > code:
> > >
> > > Word GYear, GMonth, GDay;
> > > TDateTime GDate;
> > >
> > > ADOQuery1->Close();
> > > ADOQuery1->SQL->Clear();
> > > ADOQuery1->SQL->Add("SELECT * ");
> > > ADOQuery1->SQL->Add("FROM Dag ");
> > > ADOQuery1->SQL->Add("WHERE Employee = " + QuotedStr(AnEmployee));
> > > ADOQuery1->Open();
> > > ADOQuery1->First();
> > > while (!ADOQuery1->Eof)
> > > {
> > > GDate = ADOQuery1->FieldValues["Dag"];
> > > DecodeDate(GDate, GYear, GMonth, GDay);
> > > if (GYear == ComboBox1->Text) {
> > > StringGrid1->Cells[StrToInt(GMonth)-1][StrToInt(GDay)-1]
> = "
> > > V";
> > > }
> > > Form1->ADOQuery1->Next();
> > > }
> > > Form1->ADOQuery1->Close();
> > >
> > > Thanks,
> > >
> > > Koert Wilmink
> > > Koert@Wilmink.com
> >
Technical Details
Message-ID:
<3AA0EED6.CA24D227@intrex.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!66.26.234.2References:
<3a996c8c_1@dnews> <3A99B19D.6EC538D2@intrex.net> <3a9ab7f1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,40287e849b7aae46 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-03-03 05:34:06 PST Message-ID: <3AA0EED6.CA24D227@intrex.net> Date: Sat, 03 Mar 2001 08:17:11 -0500 From: Bruce Lecus <bwlecus@intrex.net> X-Mailer: Mozilla 4.74 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: Getting DateTime Field from MSACCESS References: <3a996c8c_1@dnews> <3A99B19D.6EC538D2@intrex.net> <3a9ab7f1_2@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.26.234.2 X-Trace: 3 Mar 2001 05:19:09 -0800, 66.26.234.2 Lines: 83 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!66.26.234.2