JODELSA
11-07-2005, 16:17:30
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
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