que es lo que realmente quieres un ejemplo de como se hace un insert?
algunos lo hacen asi :
Código Delphi
[-]with fmodulo.qry_registra do
begin
sql.Add('insert into volantes(usuario,recibe,volante,fecha_oficio)');
sql.Add('values (:usuario,:recibe,:volante,:fecha_oficio);');
Parameters.ParamByName('usuario').Value:=Trim(Fprincipal.wusuario);
Parameters.ParamByName('recibe').Value:=wrecibio;
Parameters.ParamByName('volante').Value:= woficio;
Parameters.ParamByName('fecha_oficio').AsDate:= Fregistro.dtp_fecha_oficio.Date;
try
ExecSQL;
application.MessageBox('Registro Almacenado Correctamente','',mb_ok + mb_iconinformation);
exit;
except
on E:EOleException do
begin
MessageDlg(Format('Error: %s Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
exit;
end;
end;
end;
sin embargo a mi no me funciona lo que a mi me funciona es:
Código Delphi
[-]
with fmodulo.qry_registra do
begin
sql.Add('INSERT INTO VOLANTES (');
Sql.Add(' usuario,');
sql.Add(' recibe,');
sql.Add(' volante,');
sql.Add(' fecha_oficio');
sql.Add(' ) values (');
sql.Add(' '+QuotedStr(Fprincipal.wusuario)+', ');
sql.Add(' '+QuotedStr(wrecibio)+', ');
sql.Add(' '+QuotedStr(woficio)+', ');
sql.Add(' '+QuotedStr(DateToStr(wfechaoficio))+')'); try
ExecSQL;
application.MessageBox('Registro Almacenado Correctamente','',mb_ok + mb_iconinformation);
exit;
except
on E:EOleException do
begin
MessageDlg(Format('Error: %s Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
exit;
end;
end;
end;