Change fieldvalues from a specified record?
Posted: Thu 30 Nov 2006 02:21
hello
i tried to search in this forum and in mydac help but i dont found any solution for my problem. i want to change some or all fields from a record in any table. what i know is the recNo and which fieldvalues i need to change. but how do i do that (on-the-fly)?
i try it like this:
and how do i get fieldvalues from a specified recordnumber?
i tried to search in this forum and in mydac help but i dont found any solution for my problem. i want to change some or all fields from a record in any table. what i know is the recNo and which fieldvalues i need to change. but how do i do that (on-the-fly)?
i try it like this:
Code: Select all
App->MyQuery->SQL->Text = "select * from Profiles";
App->MyQuery->Open();
for(int i = 0; i Items->Count; i++)
{
if(ProfilesList->Items->Item[i]->Checked)
{
App->MyQuery->RecNo = StrToInt(ProfilesList->Items->Item[i]->Caption); //RecNo which i need to change fieldvalues
App->MyQuery->FieldByName("Age")->AsInteger = 0;
App->MyQuery->UpdateRecord();
}
}