procedure TForm1.Button1Click(Sender: TObject); var constr: String; begin constr := 'Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Credit'; with AdoConnection1 do begin Connected := false; ConnectionString := constr; Connected := true; end; with AdoQuery1 do begin Connection := AdoConnection1; Close; SQL.Text := ' delete from tablename where tablecol =:edit1'; Parameters.ParamByName('edit1').value :=trim(edit1.text); ExecSql; end; end;
var
constr: String;
begin
constr := 'Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=Credit';
with AdoConnection1 do
begin
Connected := false;
ConnectionString := constr;
Connected := true;
end;
with AdoQuery1 do
begin
Connection := AdoConnection1;
Close;
SQL.Text := ' delete from tablename where tablecol =:edit1';
Parameters.ParamByName('edit1').value :=trim(edit1.text);
ExecSql;
end;
end;