Advertisement
Guest User

Untitled

a guest
May 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.04 KB | None | 0 0
  1. var Pid, command, x, anstdatum: string;
  2.  Telnr: integer;
  3. begin
  4. try
  5.  Pid := textbox1.text;
  6.  Telnr := int32.parse(textbox2.text);
  7.   anstdatum := textbox3.text;
  8.   x := '''';
  9.   Suntripdb.open;
  10.   try
  11. command:='UPDATE Personal SET telefon='+x+telnr.tostring+x+', anstdatum='+x+anstdatum+x+'WHERE pid='+x+pid+x;
  12. mittinsert := bdpcommand.create(command, suntripDB);
  13. mittinsert.executenonquery;
  14.  
  15.  if textbox2.text<>'' then
  16.  begin
  17.  command := 'UPDATE Personal SET anstdatum=' + x + anstdatum.tostring + x +'WHERE pid=' + x + pid + x;
  18.  mittinsert := bdpcommand.create(command, suntripDB);
  19.  mittinsert.executenonquery;
  20.  end;
  21.  if textbox3.text<>'' then
  22.  begin
  23.  command := 'UPDATE Personal SET telefon=' + x + telnr.tostring + x +'WHERE pid=' + x + pid + x;
  24.  mittinsert := bdpcommand.create(command, suntripDB);
  25.  mittinsert.executenonquery;
  26.   end;
  27.  
  28.  label5.Text := 'Du har lyckats ändra telefon nummer till ' + telnr.tostring;
  29.  finally
  30.   suntripdb.close;
  31.   end;
  32.  except on
  33. system.FormatException do
  34. label5.text := 'Felaktig inmatning';
  35. end
  36. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement