Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Conexión con bases de datos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-06-2006
Avatar de Enan0
Enan0 Enan0 is offline
Miembro
 
Registrado: may 2004
Ubicación: Argentina
Posts: 565
Poder: 20
Enan0 Va por buen camino
sybase + storeprocedure y RollBack

Hola Amigos. tengo un pequeñito inconveniente.
Estoy trabajando con una aplicacion ya desarrollada la cual debo verificar como funciona.
la misma esta hecha con los componentes DBE. anda todo perfecto. se utiliza para eliminar unas datos de unas tablas, por medio de storeprocedures.. es problema es que no me funciona el RollBACK

aca dejo un poco del codigo, talvez el problema ande por ahi.. yo no he podido encontrarlo.. saludos.


Código Delphi [-]

(*tpDelBy..=TstoredProc
   TT4db = Tdatabase*)

        if not tt4db.InTransaction then
          tt4db.StartTransaction;

        if chkTasks.Checked then
        begin
          if stpDelByDate.Active then  stpDelByDate.Active:=false;
          stpDelByDate.ParamByName('@ATYPE').Value:=0;
          stpDelByDate.ParamByName('@ADATE').Value:=SelectedDate;
          stpDelByDate.ParamByName('@TOTALROWS').Value:=0;
          stpDelByDate.ExecProc;
          Totalrecs:=Totalrecs+stpDelByDate.ParamByName('@TOTALROWS').Value;
        end;

        if chkAppts.Checked then
        begin
          if stpDelByDate.Active then  stpDelByDate.Active:=false;
          stpDelByDate.ParamByName('@ATYPE').Value:=4;
          stpDelByDate.ParamByName('@ADATE').Value:=SelectedDate;
          stpDelByDate.ParamByName('@TOTALROWS').Value:=0;
          stpDelByDate.ExecProc;
          Totalrecs:=Totalrecs+stpDelByDate.ParamByName('@TOTALROWS').Value;
        end;

        if chkContacts.Checked then
        begin
          if stpDelByDate.Active then  stpDelByDate.Active:=false;
          stpDelByDate.ParamByName('@ATYPE').Value:=1;
          stpDelByDate.ParamByName('@ADATE').Value:=SelectedDate;
          stpDelByDate.ParamByName('@TOTALROWS').Value:=0;
          stpDelByDate.ExecProc;
          Totalrecs:=Totalrecs+stpDelByDate.ParamByName('@TOTALROWS').Value;
        end;

        if chkAllOthers.Checked then
        begin
          if stpDelOthers.Active then  stpDelOthers.Active:=false;
          stpDelOthers.ParamByName('@ADATE').Value:=SelectedDate;
          stpDelOthers.ParamByName('@TOTALROWS').Value:=0;
          stpDelOthers.ExecProc;
          Totalrecs:=Totalrecs+stpDelOthers.ParamByName('@TOTALROWS').Value;
        end;

        if chkNotes.Checked then
        begin
          if stpDelAttached.Active then  stpDelAttached.Active:=false;
          stpDelAttached.ParamByName('@ADATE').Value:=SelectedDate;
          stpDelAttached.ParamByName('@TOTALROWS').Value:=0;
          stpDelAttached.ExecProc;
          Totalrecs:=Totalrecs+stpDelAttached.ParamByName('@TOTALROWS').Value;
        end;

        if totalrecs>0 then
        begin
          delMsg:=IntToStr(Totalrecs)+
                  ' selected records for all users, older than and equal to '+
                  msgDate + ' will be deleted, are you sure?';
          if MessageDlg(delMsg,mtWarning,[mbYes,mbNo],0)=mrYes then
          begin
            if tt4db.InTransaction then
            begin
              tt4db.commit;
              stbMsg.Panels[0].Text:=IntToStr(Totalrecs)+
                                     ' selected record(s) were deleted';
            end;
          end
          else
          begin
            if tt4db.InTransaction then  tt4db.Rollback;
            stbMsg.Panels[0].Text:='All affected record(s) were rollbacked';
          end;
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Procedimientos almacenados en delphi con storeprocedure pgl Firebird e Interbase 7 05-11-2005 00:58:53
RollBack con más de una transacción kikodelphi MS SQL Server 2 12-10-2005 20:24:25
Ejecutar un rollback micayael PHP 4 22-09-2005 15:36:54
Uso adecuado de Rollback rochi Firebird e Interbase 4 20-11-2004 20:10:55
Ado - Sybase Ricardo Alfredo Varios 0 03-10-2003 01:28:48


La franja horaria es GMT +2. Ahora son las 08:13:20.


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