🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

ADOExpress and Access2k

#5889
From: Frog
Date: Mon, 01 Jan 2001 04:30
31 lines
2033 bytes
Hi, All
I have a problem and need to help. When I insert a lot of records into a
table in access2k db with TADOTable component, I found some records can be
duplicated although I have already defined the uniqe primary key in the
table. The problem may be out of Date/Time field. but I cannot figure it out
why some records can be duplicated, even cannot be queried.
BTW, whether I must use DateTimeFormat function to convert Date/Time field
before appending a record with a Date/Time field to the table?

    frmdm->ADOTableLocal->Close();
    frmdm->ADOTableLocal->TableName = "test";
    frmdm->ADOTableLocal->Open();
    for (int i = 0; i < Pnum; i++) {
        if (p[i] != 0) {
            frmdm->ADOTableLocal->Append();
            frmdm->ADOTableLocal->FieldByName("Fqnum")->AsInteger =
PFstid[i];
            frmdm->ADOTableLocal->FieldByName("RainID")->AsInteger =
Pstid[i];
            frmdm->ADOTableLocal->FieldByName("DTime")->AsDateTime =
CurrTime;
            frmdm->ADOTableLocal->FieldByName("RainValue")->AsFloat = p[i];
            frmdm->ADOTableLocal->Post();
        }
    }

thanks in advance
--

Frog
Email: hhushy@bigfoot.com
Technical Details
Message-ID: <3a5007cc_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!202.102.106.226

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,25271af8cd551c10,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2000-12-31 20:36:42 PST
From: "Frog" <hhushy@bigfoot.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: ADOExpress and Access2k
Date: Mon, 1 Jan 2001 12:30:29 +0800
Lines: 34
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: 202.102.106.226
Message-ID: <3a5007cc_1@dnews>
X-Trace: 31 Dec 2000 20:30:04 -0800, 202.102.106.226
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!202.102.106.226