🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Getting DateTime Field from MSACCESS

#5723
From: Koert Wilmink
Date: Sun, 25 Feb 2001 20:33
37 lines
1796 bytes
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: <3a996c8c_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!hammer.uoregon.edu!feed.textport.net!news.bnb-lp.com!bornews.borland.com!dnews!195.121.46.108

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,40287e849b7aae46,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-02-25 12:40:06 PST
From: "Koert Wilmink" <koert@wilmink.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Getting DateTime Field from MSACCESS
Date: Sun, 25 Feb 2001 21:33:54 +0100
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 195.121.46.108
Message-ID: <3a996c8c_1@dnews>
X-Trace: 25 Feb 2001 12:35:24 -0800, 195.121.46.108
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!hammer.uoregon.edu!feed.textport.net!news.bnb-lp.com!bornews.borland.com!dnews!195.121.46.108