Code:
procedure BrisiTabelu(const sNazivTabele: string);
begin
with AdoQuery do
begin
Close;
SQL.Text := Format('DELETE FROM %S', [sNazivTabele]);
ExecSQL;
end;
end;
procedure ProveriDaLiPostojiPodatak(
const sNazivTabele, sNazivKolone, sPodatak: string);
begin
with AdoQuery do
begin
Close;
SQL.Text := Format('select count(*) FROM %s where %s = %s',
[sNazivTabele, sNazivKolone, sPodatak]);
Open;
ShowMessageFmt('%d redova sa podatkom %s u tabeli %s i koloni %s',
[Fields[0].AsInteger, sPodatak, sNazivTabele, sNazivKolone]);
end;
end;
Marcha
-----------------------------------
Pretpostavka je majka zajeba.