🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Append violating primary key???

#4283
From: Jens Weiermann
Date: Wed, 30 Jan 2002 12:39
18 lines
1552 bytes
Hi! I'm trying to import some data from ascii files into a SQL server
database. This is the code I'm using:

               ADOTable1->Insert();
               ADOTable1->FieldByName("ChipNr")->AsString = ChipNr;
               ADOTable1->FieldByName("Direction")->AsString = "I";
               ADOTable1->FieldByName("Date")->AsDateTime =
StrToDateTime(DatumZeit);
               ADOTable1->Post();

However, the ADOTable->Insert() throws an exception, stating that the
primary key would be violated. Isn't Insert() supposed to insert an empty
record into the database? I expected the PK violation when issueing the
Post() statement, not when Insert()ing ...
Any clues?

Thanks,
Jens
Technical Details
Message-ID: <3c57e998_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!hub1.nntpserver.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,db60e3a349385965,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-01-30 04:51:54 PST
From: "Jens Weiermann" <wexmanATsolidsoftwareDOTde>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Append violating primary key???
Date: Wed, 30 Jan 2002 13:39:43 +0100
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 62.157.89.130
Message-ID: <3c57e998_2@dnews>
X-Trace: dnews 1012394392 62.157.89.130 (30 Jan 2002 04:39:52 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!hub1.nntpserver.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews