Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 11-07-2005
JODELSA JODELSA is offline
Miembro
 
Registrado: may 2003
Posts: 89
Poder: 21
JODELSA Va por buen camino
error en manejo de transacciones

Estoy tratando de manejar no se si lo hago de forma correcta, pero trato de aplicarlo en los procesos donde actualizo mas de una tabla. Utilizo ADO y MySQL.

Este es uno de los casos:

dm.ADOCon.BeginTrans;
try
// actualizando archivo control de prestamos
Dm.QryControl.open;
Dm.QryControl.edit;
Dm.QryControlNoprestamo.Value:=StrToInt(ENoprestamo.text);
Dm.Qrycontrol.Post;

// actualizando archivo de prestamo
dm.Qryprestamo.Append;
Dm.QryprestamoNoprestamo.Value:=StrToInt(Enoprestamo.Text);
Dm.QryprestamoCedula.Value:=Mecedula.Text;
Dm.QryprestamoEmpresa.Value:=dcbEmpresa.Text;
Dm.QryprestamoTipoPrestamo.Value:=cbTipoPrestamo.Text;
Dm.QryprestamoFecha.Value:=StrToDate(DtpFecha.text);
Dm.QryprestamoMontop.Value:=StrToCurr(Emonto.text);
Dm.QryprestamoTiempoP.Value:=StrToInt(Etiempo.Text);
Dm.QryprestamoTasa.Value:=StrToFloat(Etasa.Text);
Dm.QryprestamoInteres.Value:=StrToCurr(EIntereses.Text);
Dm.QryprestamoCuotaP.Value:=StrToCurr(ECuota.Text);
Dm.QryprestamoBalanceP.Value:= StrToCurr(Ebalance.text);
Dm.QryprestamoUsCrea.Value:=Vusuario;
Dm.QryPrestamoStatus.value := 'A';
Dm.QryPrestamo.post;

// Acturalizando Archivo de cuotas con el archivo temporal
Dm.QryCuotas.Open;
QryTmpCuotas.First;
While not QryTmpCuotas.Eof do
begin
Dm.QryCuotas.Append;
Dm.QryCuotasPrestamoNo.Value:=StrToInt(Enoprestamo.text);
Dm.QryCuotasCedula.value:=MEcedula.Text;
Dm.QryCuotasNoCuota.Value:=QryTmpCuotasNocuota.Value;
Dm.QryCuotasValorCuota.Value:=StrToCurr(ECuota.Text);
Dm.QryCuotasFechaCuota.Value:=QryTmpCuotasFechaCuota.Value;
Dm.QryCuotasInteresCta.Value:=QryTmpCuotasInteresCta.Value;
Dm.QryCuotasCapitalCta.Value:=QryTmpCuotasCapitalCta.Value;
Dm.QryCuotasStatusCuota.Value:='PENDIENTE';
Dm.QryCuotasEmpresa.Value:=dcbEmpresa.Text;
Dm.QrycuotasTipoPrestamo.Value:=cbTipoPrestamo.Text;
dm.QryCuotasSP.Value:='A';
Dm.QryCuotas.post;
QryTmpCuotas.Next;
end;
except
dm.ADOCon.RollbackTrans;
showmessage('El prestamo no pudo procesarse...!');
end;
dm.ADOCon.CommitTrans;

yo provoqué un error para probar y me arrojo este mensaje:

[MySQL][ODBC 3.51 Driver]Warning: some-non transactional changed tables couldn't be rolled back

Que me pueden decir y como me pueden ayudar
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 17:34:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi