Ver Mensaje Individual
  #6  
Antiguo 25-04-2011
_CALI _CALI is offline
Miembro
 
Registrado: mar 2008
Posts: 99
Reputación: 17
_CALI Va por buen camino
Smile una posible solucion

una posible solucion fue personalizar el metodo de Update del proveedor

Código Delphi [-]
 
procedure TDM.dspVendedoresBeforeUpdateRecord(Sender: TObject;
  SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind;
  var Applied: Boolean);
begin
if UpdateKind=ukModify then
  begin
    asignar(cmdVendedores, DeltaDS);
    cmdVendedores.Execute;
    Applied:=true;
  end;
 
end;

el procedimiento q se ancarga de pasar los datos del clientedataset al commando :

Código Delphi [-]
 
procedure asignar(comando: TADOCommand; cDataSet: TCustomClientDataSet);
var i: integer;
  begin
   for I := 0 to comando.Parameters.Count - 1 do
           begin
           if  VarIsNull(cDataSet.FieldByName(comando.Parameters.Items[i].Name).Value) then
               comando.Parameters.Items[i].Value := cDataSet.FieldByName(comando.Parameters.Items[i].Name).OldValue
           else
               comando.Parameters.Items[i].Value := cDataSet.FieldByName(comando.Parameters.Items[i].Name).Value;

           end;
  end;


funciona bien pero aun tengo dudas, no se supone q en un campo del cliente data set asi no ingrese un dato es se asume como cadena vacia ''?, me causaba un error al momento de ejecurar el command diciendome q el valor era nulo.

alguna otra recomnedacion gracias de antemano
Responder Con Cita