Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   Grabar Imagen en campo BLOB Firebird (https://www.clubdelphi.com/foros/showthread.php?t=20099)

pcicom 06-04-2005 01:34:06

Grabar Imagen en campo BLOB Firebird
 
Como puedo Grabar una IMAGEN en un CAMPO BLOB mediante una instruccion SQL UPDATE xx SET foto= ?????

o si es posible angun otro METODO que sea RAPIDO, actualmente lo estoy haciendo con un TIBTable pero en el momento de ABRIR la Tabla se tarda un BUEN RATO y no pasa lo mismo cuandlo lo cargo con un TIBquery

Asi lo CARGO y va super RAPIDO...

Código:

          qryMFOTO.SQL.Clear;
          qryMFOTO.SQL.Add('SELECT AUT_NUME,AUT_FOTO,AUT_FEXT FROM mfoto WHERE AUT_NUME='+LLAVE.Text);
          qryMFOTO.Open;
          if not qryMFOTO.Eof then
          begin
            lExistMFOTO := true;
            Try
              Stream := TMemoryStream.Create;
              TBlobField(qryMFOTO.FieldByName('AUT_FOTO')).SaveToStream(Stream);
              if Stream.Size > 0 then
              begin
                Stream.Position := 0;
                if Pos(TRIM(NoNullC(qryMFOTO['AUT_FEXT'])),'.JPEG.JPG')>0 then
                begin
                    jpg := TJpegImage.Create;
                    jpg.LoadFromStream(Stream);
                    FOTO.Picture.Assign(Jpg);
                    jpg.free;
                end
                ELSE
                    FOTO.Picture.Bitmap.LoadFromStream(Stream);
              end;
              stream.Free;
            except
              showmessage('El formato del Archivo o Fotografia es Invalido');
            end;
          end
          ELSE
              FOTO.Picture := NIL;


Si existe algun metodo para GRABAR cualquier IMAGEN o archivo a algun campo BLOB que no sea el TIBTable seria GENIAL...

La intencion mia es que mi sistema se maneja entre SUCURSALES y quisiera que el tiempo de respuesta sea lo mas eficiente que se pueda, , ya que usando el TIBTable tarda un rato en habilitar la pantalla....


La franja horaria es GMT +2. Ahora son las 02:55:04.

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