1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
void __fastcall TForm1::Button4Click(TObject *Sender)
{
//incertion d'une valeur dans la DB
this->Query2->SQL->Clear();
this->Query2->SQL->Add("INSERT INTO Notes VALUES ( Edit1->Text.c_str())");
this->Query2->ExecSQL();
//selection de la valeur de la deuxieme DB
this->Query2->SQL->Clear();
this->Query2->SQL->Add("SELECT n.nom AS nom FROM Notes n ");
val2 = Query2->FieldByName("nom")->AsString;
this->Query2->ExecSQL();
//selection de la valeur de la premiere DB
this->Query1->SQL->Clear();
this->Query1->SQL->Add("SELECT n.nom AS nom FROM Notes n ");
val1 = Query1->FieldByName("nom")->AsString;
this->Query1->ExecSQL();
//affichage
Memo1->Lines->Add(val1+" "+val2);
} |