Kod: Tümünü seç
procedure TForm2.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);var
kontrol :boolean;
a,b: string;
ad,soyad :string;
begin
if button=nbdelete then
begin
a:= dbgrid1.DataSource.DataSet.FieldValues [('Adi')];
b:= dbgrid1.DataSource.DataSet.FieldValues [('Soyadi')];
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select Adi from kullanicilar where Adi=:a');
adoquery1.parameters.ParamByName('a').Value:=a;
adoquery1.Open;
ad:=adoquery1.FieldByName('Adi').AsString;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select Soyadi from kullanicilar where Soyadi=:b') ;
adoquery1.parameters.ParamByName('b').Value:=b;
adoquery1.Open;
soyad:=adoquery1.FieldByName('Soyadi').AsString;
kontrol:=adotable2.Locate('Adi;Soyadi',varArrayof([ad,soyad]),[]);
end;
try
if kontrol then
begin
adoquery1.Close;
Adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete from kullanicilar where Adi=:ad and Soyadi=:soyad' ) ;
adoquery1.Open;
adoquery1.ExecSQL;
end;
except
end;
end;
1. hata
project.project1.exe raised exception class EvariantTypeCastError with message ' could not convert variant of type (Null) into type (Ole str)'// bu hata son kaydı sildiğimde oluşuyor
2. hata
project.project1.exe raised exception class EdatabaseError with message 'ADOQuery1: Commandtext does not return a result set'
Saygılarımla