 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Phil Robertson Guest
|
Posted: Tue Apr 06, 2004 10:25 pm Post subject: Re: Inserting multiple records to linked tables |
|
|
EDW,
Interesting. Thanks for the update.
--
Phil Robertson
BSIT [email]phil4114 (AT) email (DOT) uophx.edu[/email]
Work [email]Phil.Robertson (AT) hayssen (DOT) com[/email]
Home [email]PhilR80245 (AT) aol (DOT) com[/email]
-----------------------------------------------------------
"EDW" <aegis45 (AT) hotmail (DOT) com> wrote
| Quote: |
I figured out what the problem was. In case anyone else was reading this
thread.
I had to refresh the DB after each post, otherwise it was freaking out
when I selected the new last record. So now this works.
for(int i = 0; i < datacount; i++)
{
Table1->Last();
index = Table1->FieldValues["PRI_ID"];
index++;
Table1->Insert();
Table1->FieldValues["PRI_ID"] = index;
Table1->FieldValues["DATA"] = data[i];
Table1->Post();
Table2->Insert();
Table2->FieldValues["PRI_ID"] = index;
Table2->FieldValues["DATA"] = dataA[i];
Table2->Post();
Table3->Insert();
Table3->FieldValues["PRI_ID"] = index;
Table3->FieldValues["DATA"] = dataB[i];
Table3->Post();
Table1->Refresh();
Table2->Refresh();
Table3->Refresh();
}
|
|
|
| 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
|
|