Ir al contenido


Foto

Por que me saldra este error en Zeos


  • Por favor identifícate para responder
6 respuestas en este tema

#1 JoAnCa

JoAnCa

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 775 mensajes
  • LocationPinar del Río, Cuba

Escrito 07 abril 2015 - 09:48

Tengo una aplicación que usa MySQL con los componentes Zeos, pero de pronto me da el error que adjunto en la imagen, en algunos casos al calcular los indicadores sale bien pero en otros casos no, cierro y vuelvo a abrir la aplicación por si es el registro bloqueado, pero nada, sigue dando el error en el mismo lugar cuando trato de hacer los calculos

 

"El error me dice que 0 registros actualizados, solo un registro puede ser actualizado"

 

Pero no entiendo por que razon será este error???

 

La aplicacion consiste, entre otras cosas, en la entrada de algunos indicadores economicos para cada unidad de costo (UC)

En una parte se introduce el plan manualmente para cada UC que se selecciona de un combo

El real se calcula en otra parte, tambien seleccionando la UC

 

El error me lo da al calcular algunas UC, y en otras calcula bien

Archivos adjuntos


  • 0

#2 JoAnCa

JoAnCa

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 775 mensajes
  • LocationPinar del Río, Cuba

Escrito 07 abril 2015 - 10:28

Olvide poner la imagen, pero cuando fui a ponerla modificando el post, me dijo que no tenia permisos para hacerlo

¿¿   :undecided:  ??

 

 

Archivo adjunto  errorZeos.png   34,32KB   1 descargas

 

 

Que raro?  A pesar de que me diijo que no tenia permisos de editar, ahora veo que si adjunto la imagen en el primero :shocked:


Editado por JoAnCa, 07 abril 2015 - 10:32 .

  • 0

#3 Delphius

Delphius

    Advanced Member

  • Administrador
  • 6.295 mensajes
  • LocationArgentina

Escrito 07 abril 2015 - 10:46

Ummm. Lo primero en lo que pienso es que hay sentencia sql UPDATE que en su parte WHERE hay un condicional que no se cumple con lo que al final no se actualizan los registros.

Pero si ver algo de código no tengo algo más concreto con que jugar.

 

Saludos,


  • 0

#4 JoAnCa

JoAnCa

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 775 mensajes
  • LocationPinar del Río, Cuba

Escrito 07 abril 2015 - 11:02

La actualizacion la hago escribiendo en el TZtable que es una SQL actualizable

sql
  1. SELECT
  2. certifico.CodUnid,
  3. nom_unidcosto.UnidadCosto,
  4. nom_indiccertif.IndicadorCert,
  5. certifico.Plan,
  6. certifico.`Real`,
  7. certifico.Mes,
  8. certifico.Anno
  9. FROM
  10. nom_indiccertif
  11. INNER JOIN certifico ON certifico.IdIndCERT = nom_indiccertif.IdIndicCert
  12. INNER JOIN nom_unidcosto ON nom_unidcosto.CodUnid = certifico.CodUnid ;


Mediante este código:



delphi
  1.   with ModBD_Global, ModBD_Global.ztCertifSalario do
  2.   begin
  3.     ztResumIndEfic.Filtered:=False;
  4.     ztResumIndEfic.Filter:='CodUnid = '+ QuotedStr(ztUnidCostoCodUnid.Value) +' AND Mes = '+ IntToStr(cbbMes.ItemIndex+1) +' AND Anno = '+ FloatToStr(spAnno.Value);
  5.     ztResumIndEfic.Filtered:=True;
  6.     First;
  7.     while not Eof do
  8.     begin
  9.       Edit;
  10.       case RecNo of
  11.         1:begin  //--- Utilidades ---
  12.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundUtilAcum.Value
  13.             else ztCertifSalarioReal.Value:=(ztResumIndEficTotIngAcum.Value - ztResumIndEficTotGastAcum.Value);
  14.           end;
  15.         2:begin  //--- Total Ingresos  ---
  16.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundIngTotAcum.Value
  17.             else ztCertifSalarioReal.Value:=ztResumIndEficTotIngAcum.Value;
  18.           end;
  19.         3:begin  //--- Ventas Netas ---
  20.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundVNetasAcum.Value
  21.             else ztCertifSalarioReal.Value:=ztResumIndEficVentasNetAcum.Value;
  22.             VNPlan:=ztCertifSalarioPlan.Value;
  23.           end;
  24.         4:begin  //--- Total de Gastos ---
  25.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundGastoTotAcum.Value
  26.             else ztCertifSalarioReal.Value:=ztResumIndEficTotGastAcum.Value;
  27.           end;
  28.         5:begin  //--- Salario ---
  29.             if ztUnidCostoOC.Value = -1 then SalarioR:=ztIndFundSalario.Value
  30.             else SalarioR:=ztResumIndEficFSalarioAcum.Value;
  31.             SalPlan:=ztCertifSalarioPlan.Value;
  32.             ztCertifSalarioReal.Value:=SalarioR;
  33.           end;
  34.         6:begin  //--- Costo de Mercancias ---
  35.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundCostoMerc.Value
  36.             else ztCertifSalarioReal.Value:=ztResumIndEficCostoMercAcum.Value;
  37.             CMPlan:=ztCertifSalarioPlan.Value;
  38.           end;
  39.         7:begin  //--- Gasto Material ---
  40.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundGastMat.Value
  41.             else ztCertifSalarioReal.Value:=ztResumIndEficGastoMatAcum.Value;
  42.             GMPlan:=ztCertifSalarioPlan.Value;
  43.           end;
  44.         8:begin  //--- Servicios Comprados ---
  45.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundServComp.Value
  46.             else ztCertifSalarioReal.Value:=ztResumIndEficServCompAcum.Value;
  47.             SCPlan:=ztCertifSalarioPlan.Value;
  48.           end;
  49.         9:begin  //--- VAB ---
  50.             VAPlan:=VNPlan - (GMPlan + CMPlan + SCPlan);
  51.             ztCertifSalarioPlan.Value:=VAPlan;
  52.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundVAB.Value
  53.             else ztCertifSalarioReal.Value:=ztResumIndEficVABAcum.Value;
  54.           end;
  55.        10: begin //--- IngMon / VAB ---
  56.             IMPlan:=SalPlan / VAPlan;
  57.             if ztUnidCostoOC.Value = -1 then ztCertifSalarioReal.Value:=ztIndFundIngVAB.Value
  58.             else ztCertifSalarioReal.Value:=ztResumIndEficIngMonVABAcum.Value;
  59.            end;
  60.        11:begin  //--- Salario Creado ---
  61.            if ztUnidCostoOC.Value = -1 then SalCreado:=ztIndFundVAB.Value * IMPlan
  62.            else SalCreado:=ztResumIndEficVABAcum.Value * IMPlan;
  63.            ztCertifSalarioReal.Value:=SalCreado;
  64.           end;
  65.        12:begin  //--- Salario Disponible ---
  66.            ztCertifSalarioReal.Value:=SalCreado - SalarioR;
  67.           end;
  68.        13:begin  //--- Porciento ---
  69.            Pcto:=StrToFloatDef(edtPcto.Text, 0);
  70.            ztCertifSalarioReal.Value:=Pcto;
  71.           end;
  72.        14:begin  //--- Salario a Pagar ---
  73.            ztCertifSalarioReal.Value:=((SalCreado - SalarioR) * Pcto)/100;
  74.           end;
  75.       end;
  76.       Post;
  77.       Next;
  78.     end;
  79.     ztResumIndEfic.Filtered:=False;
  80.   end;

Pero lo raro es que en la version que esta de prueba funciona bien, y en la que estoy trabajando me esta dando el error, pero no recuerdo haber modificado esta parte
 
El error salta cuando hace el post despues del calculo 10

Editado por enecumene, 07 abril 2015 - 03:40 .

  • 0

#5 enecumene

enecumene

    Webmaster

  • Administrador
  • 7.419 mensajes
  • LocationRepública Dominicana

Escrito 07 abril 2015 - 03:38

Prueba colocando la propiedad en ZDataset.Properties lo siguiente:
 

delphi
  1. ValidateUpdateCount := False;

Normalmente es un problema de claves primarias (Primary Key Constrains).


Saludos.
  • 0

#6 luk2009

luk2009

    Advanced Member

  • Moderadores
  • PipPipPip
  • 2.040 mensajes
  • LocationSanto Domingo

Escrito 07 abril 2015 - 07:05

http://zeoslib.sourc...t=3449&start=45

 

enecumene tiene razon, lo que he leido es que tiene que ver con las llaves primarias.

aunque parece que es un bug que aparece en algunas versiones de zeos.

 

lee la informacion y verifica si te sirve


  • 0

#7 JoAnCa

JoAnCa

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 775 mensajes
  • LocationPinar del Río, Cuba

Escrito 21 abril 2015 - 06:51

Despues de unos dias de vacaciones, vuelvo a conectame para dar como solucionado el post

Pues todo indica a que es un bug de las nuevas versiones de Zeos, ya que todo comenzo cuando actualice el componente

La version que mencione que funciona bien, esta con la version 6 de zeos

Lo que hice fue volver a la version 6.6.5 de zeos y ya todo funciona bien de nuevo


  • 1




IP.Board spam blocked by CleanTalk.