Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (edit1.Text <> '') and (dblookupcombobox1.KeyField <> '') then
- begin
- // comprovar l'id més gran i sumarli un.
- query5.sql.text := 'Select MAX(id) from denuncia';
- query5.Open;
- query5.close;
- id_mes1 := query5.Fields[0].AsInteger + 1;
- query5.sql.text := 'Select codi from delicte where nom = '+ dblookupcombobox1.KeyValue;
- showmessage(query5.SQL.Text);
- query5.Open;
- id_tipus_denuncia := query5.Fields[0].AsInteger;
- query5.close;
- ara := formatdatetime('mm/dd/yyyy hh:nn:ss', now());
- query5.sql.text := 'INSERT INTO denuncia VALUES (' + inttostr(id_mes1) + ',' + quotedstr(dbtext1.Caption) + ',' + inttostr(id_tipus_denuncia) + ','+quotedstr(ara)+','+inttostr(1)+','+ quotedstr(edit1.Text) +')';
- showmessage(query5.SQL.Text);
- query5.ExecSQL;
- showmessage('Denuncia Inserida correctament.');
- query5.close;
- end
- else
- begin
- // Està buit
- showmessage('Has d´omplir els camps');
- end;
- end;
Add Comment
Please, Sign In to add comment