Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages
Started by Frog
Mon, 01 Jan 2001 04:30
ADOExpress and Access2k
Author: Frog
Date: Mon, 01 Jan 2001 04:30
Date: Mon, 01 Jan 2001 04:30
31 lines
2033 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads