Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 14-03-2007
Avatar de pnsd_89
pnsd_89 pnsd_89 is offline
Miembro
 
Registrado: mar 2007
Posts: 112
Poder: 20
pnsd_89 Va por buen camino
Arrow Ok...

Código Delphi [-]
procedure TFSucursal.BitBtn3Click(Sender: TObject);
var
   sSQL, sFROM, sWHERE, sORDER, sEsquema,sent: string;
begin
     sSQL   := EmptyStr;
     sFROM  := EmptyStr;
     sWHERE := EmptyStr;
     sORDER := EmptyStr;

     sEsquema := 'dba.';


     sSQL  := 'select * ';
     sFROM := 'from '+sEsquema+'sucursal_mh ';
     sWHERE:= 'where 0 = 0 ';

     if not ( Trim( DBLFiltra_sucursal.Text ) = EmptyStr ) then
        sWHERE := sWHERE + 'and cod_sucursal_mh = '+ (DBLFiltra_sucursal.KeyValue);
     sORDER := ' order by des_sucursal_mh';
     DMSucursales.QrySucursal_MH.SQL.Clear;
     DMSucursales.QrySucursal_MH.SQL.Add ( sSQL + sFROM + sWHERE + sORDER );
     DMSucursales.CDSsucursal_mh.Close;
      sent:=(sSQL+sFROM+sWHERE+sORDER);
      ShowMessage(sent);
     UCerrarAbrirPG(DMSucursales.CDSsucursal_mh, Self); {aqui salta a la funcion (en realidad no se si es una funcion o petodo. y salta a este codigo siguiente En un na UNIDAD01}

{...}

Código Delphi [-]
procedure UCerrarAbrirPG(DataSet: TDataSet; Sender : TForm);
var
   nombre, ErrorM : string;
begin
     ErrorM := '';
     nombre := DataSet.Name;
     if BaseDatosPG.InTransaction then {EN este lugar no entra y salta el error }
        begin
             try
                DataSet.Close;
             except
                on E: Exception do
                   UAbrirMensaje('Error al cerrar el componente '+nombre+'.'+#13+#10+'Mensaje : '+E.Message,ierror,sender);
             end; {try}
             try
                DataSet.Open;
             except
                on E: Exception do
                   UAbrirMensaje('Error al abrir el componente '+nombre+'.'+#13+#10+'Mensaje : '+E.Message,ierror,sender);
             end; {try}
        end {if}
     else
        begin
             try
               DataSet.Close;
             except
               on E: Exception do
                  UAbrirMensaje('Error al cerrar el componente '+nombre+'.'+#13+#10+'Mensaje : '+E.Message,ierror,sender);
             end; {try}
             IniciarTransaccionPG;
             try
                BaseDatosPG.StartTransaction(TDPG);
                DataSet.Open;
                BaseDatosPG.Commit(TDPG);
             except
                on E: Exception do
                   begin
                       BaseDatosPG.Rollback(TDPG);
                       UAbrirMensaje('Error al abrir el componente '+nombre+'.'+#13+#10+'Mensaje : '+E.Message,ierror,sender);
                   end; {on}
             end; {try}
        end; {else}
end;

Edito este mensaje para añadir las etiquetas [ delphi ].

Última edición por dec fecha: 14-03-2007 a las 22:19:54.
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
raised execption eoserror code 14 nfrfabian API de Windows 1 24-02-2007 00:15:25
Exeption EStackOverflow Luana Varios 4 03-08-2005 08:15:01
error 'Access violation at address 0053CF79 in module project1' Renees Varios 3 15-03-2005 17:17:37
Project NavSistem.exe raised exception.............. Picard C++ Builder 2 31-05-2004 18:46:00
Raised Exception javiermorales OOP 24 18-09-2003 00:06:09


La franja horaria es GMT +2. Ahora son las 08:53:28.


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