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 

paradox7 tables

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





PostPosted: Wed Dec 24, 2003 12:09 pm    Post subject: paradox7 tables Reply with quote



Hi all,
Could someone pliz help me with this code:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
DeleteData();
/*
DeleteData() is a function already defined.
*/
int a;
Table1->Open();
Table1->Active = true;

for (a=1; a<sg->RowCount; a++){
Table1->Edit();
Table1->Append();
Table1->FieldValues["Process_id"] =
"Process" + a; file://my problem lies here.
Table1->FieldValues["Amv"] = sg->Cells[1][a];
Table1->FieldValues["Smv"] = sg->Cells[2][a];
Table1->Post();
}
}

With the above code, i am aiming at filling my TTable component with data
obtained from a TStringGrid component(sg) At each button click, i should
delete all data in the Table1 and then refill it using fresh data from the
sg.
The field Process_id(defined as of Type Alpha - in a paradox table) should
read something lyk "Process 1", "Process 2"; going on and naming all
processes dependent on their number on the sg. So i implemented the line:
Table1->FieldValues["Process_id"] = "Process" + a;
My field Process_id is not giving the expected results!
First output line in the DBGrid component reads 'rocess'; second reads
'ocess'...
I cant seem to figure out where am messing up.
Any ideas pliz???

MERRY X-MAS TO YOU ALL.
joshua.




Back to top
Don Locke
Guest





PostPosted: Wed Dec 24, 2003 2:08 pm    Post subject: Re: paradox7 tables Reply with quote



Table1->FieldValues["Process_id"] =
"Process" + a; file://my problem lies here.

try:
Table1->FieldValues["Process_id"] = "Process" +IntToStr(a);

Merry Christmas
Don

Back to top
joshua
Guest





PostPosted: Sun Dec 28, 2003 1:08 pm    Post subject: Re: paradox7 tables Reply with quote







"> try:
Quote:
Table1->FieldValues["Process_id"] = "Process" +IntToStr(a);

Merry Christmas
Don


thanx,
seems i was a bit myopic coz i ommited that IntToStr part.
thanx.
happy new year.
josh




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.