TheStream := TMemoryStream.Create;
if changed
then
if Application.MessageBox('
Wollen sie die Änderungen speichern?', '
Änderungen', MB_YesNoCancel
or MB_IconQuestion) = IDYes
then
begin
ZConnection1.Connected := true;
with ZQuery1
do
begin
SQL.Clear;
Showmessage(inttostr(kid));
Params.CreateParam(ftSmallint, '
id', ptInput);
Params.ParamByName('
id').Asinteger := kid;
Params.CreateParam(ftWideString, '
sex', ptInput);
Params.ParamByName('
sex').AsString := cb_anrede.Items.Strings[cb_anrede.ItemIndex];
Params.CreateParam(ftWideString, '
nn', ptInput);
Params.ParamByName('
nn').AsString := cb_nachname.Items.Strings[cb_vorname.ItemIndex];
Params.CreateParam(ftWideString, '
vn', ptInput);
Params.ParamByName('
vn').AsString := cb_vorname.Items.Strings[cb_nachname.ItemIndex];
Params.CreateParam(ftWideString, '
str', ptInput);
Params.ParamByName('
str').AsString := ed_strasse.Text;
Params.CreateParam(ftWideString, '
plz', ptInput);
Params.ParamByName('
plz').AsString := ed_plz.Text;
Params.CreateParam(ftWideString, '
ort', ptInput);
Params.ParamByName('
ort').AsString := ed_wohnort.Text;
Params.CreateParam(ftWideString, '
ph', ptInput);
Params.ParamByName('
ph').AsString := ed_telefonr.Text;
if ed_geburtsdatum.Text <> '
'
then
begin
Params.CreateParam(ftDate, '
geb', ptInput);
Params.ParamByName('
geb').Value := ed_geburtsdatum.Text;
end
else
begin
Params.CreateParam(ftString, '
geb', ptInput);
Params.ParamByName('
geb').Value := ed_geburtsdatum.Text;
end;
me_bemerkung.Lines.SaveToStream(TheStream);
Params.CreateParam(ftBlob, '
mem', ptInput);
Params.ParamByName('
mem').LoadFromStream(TheStream, ftBlob);
SQL.Add('
UPDATE Kunden SET Name = :nn, Vorname = :vn, Strasse = :str, PLZ = 92431, ort = :ort, Phone =:ph, Geburtsdatum = :geb, Memo = :mem WHERE ID_KDNR = :kid;');
ExecSQL;
end;
end;