Ver Mensaje Individual
  #9  
Antiguo 22-11-2007
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 19.437
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por SidedTermita Ver Mensaje
Entoncs para que sirve esta lista ?
Por ejemplo para generar un código como este:

Código Delphi [-]
  // Si existe o no la tabla...
  function _ExistTable:Boolean;
  const
    ERROR_TABLE_NOT_EXIST = -2147217865;  // no existe el objeto
  var
    ADOQ:TADOQuery;
  begin

    Result := True;
    ADOQ := TADOQuery.Create(nil);

    // Bloque de proteccion
    try
      ADOQ.ConnectionString := ExceptionHook.ADODBConnectionString;
      ADOQ.SQL.Add('SELECT Id FROM ' + EXCEPTIONS_TABLENAME +
                   ' WHERE Id=0');

      // Proteccion de la ejecución
      try
        ADOQ.ExecSQL;
      // error de BD
      except on E:EOleException do
        if (E.ErrorCode = ERROR_TABLE_NOT_EXIST) then begin
          Result := False;
        end;
      end;
    finally
      ADOQ.Free;
    end; // try.. finally
  end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita