Guest User

Untitled

a guest
Jul 16th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. if (edit1.Text <> '') and (dblookupcombobox1.KeyField <> '') then
  2. begin
  3. // comprovar l'id més gran i sumarli un.
  4. query5.sql.text := 'Select MAX(id) from denuncia';
  5. query5.Open;
  6. query5.close;
  7. id_mes1 := query5.Fields[0].AsInteger + 1;
  8. query5.sql.text := 'Select codi from delicte where nom = '+ dblookupcombobox1.KeyValue;
  9. showmessage(query5.SQL.Text);
  10. query5.Open;
  11. id_tipus_denuncia := query5.Fields[0].AsInteger;
  12. query5.close;
  13. ara := formatdatetime('mm/dd/yyyy hh:nn:ss', now());
  14. query5.sql.text := 'INSERT INTO denuncia VALUES (' + inttostr(id_mes1) + ',' + quotedstr(dbtext1.Caption) + ',' + inttostr(id_tipus_denuncia) + ','+quotedstr(ara)+','+inttostr(1)+','+ quotedstr(edit1.Text) +')';
  15. showmessage(query5.SQL.Text);
  16. query5.ExecSQL;
  17. showmessage('Denuncia Inserida correctament.');
  18. query5.close;
  19. end
  20. else
  21. begin
  22. // Està buit
  23. showmessage('Has d´omplir els camps');
  24. end;
  25. end;
Add Comment
Please, Sign In to add comment