 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
George Kuascha Guest
|
Posted: Sun Feb 20, 2005 4:14 pm Post subject: Primary Key value |
|
|
I'm using D6 with MS Access2000. I'm copying field data from ADOTable2 to
ADOTable1 one record at a time. After each record is copied, I need to
capture the primary key (named ID) value in a variable (FindID). After
posting the record to ADOTable1, the primary key value returned in my code
is zero. I've also tried opening and closing the table between records and
that doesn't help. Can anyone enlighted me on what I'm missing here?
with ADOTable1 do
begin
Insert;
FieldByName('Name1').Value:= ADOTable2.FieldValues['Name1'];
........
Post;
end;
FindID:= ADOTable1.FieldByName('ID').AsInteger;
showmessage(inttostr(FindID));
|
|
| Back to top |
|
 |
George Kuascha Guest
|
Posted: Sun Feb 20, 2005 10:55 pm Post subject: Re: Primary Key value |
|
|
I found my problem. I had a missing filter.
"George Kuascha" <gkhokie (AT) hotmail (DOT) com> wrote
| Quote: | I'm using D6 with MS Access2000. I'm copying field data from ADOTable2 to
ADOTable1 one record at a time. After each record is copied, I need to
capture the primary key (named ID) value in a variable (FindID). After
posting the record to ADOTable1, the primary key value returned in my code
is zero. I've also tried opening and closing the table between records and
that doesn't help. Can anyone enlighted me on what I'm missing here?
with ADOTable1 do
begin
Insert;
FieldByName('Name1').Value:= ADOTable2.FieldValues['Name1'];
.......
Post;
end;
FindID:= ADOTable1.FieldByName('ID').AsInteger;
showmessage(inttostr(FindID));
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|