BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Inserting multiple records to linked tables

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Phil Robertson
Guest





PostPosted: Tue Apr 06, 2004 10:25 pm    Post subject: Re: Inserting multiple records to linked tables Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.