![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
![]() ![]() Tengo el siguiente problema : Desde delphi utilizo un TTable la cual tiene un campo de tipo BLOB (para guardar imagenes), el codigo para almacenar la imagen es : procedure TForm1.Button1Click(Sender: TObject); var m, f: TStream; s: string; begin if OpenPictureDialog1.Execute then begin Image1.Picture.LoadFromFile(OpenPictureDialog1.filename); m := Table1.CreateBlobStream(Table1FOTO1, bmWrite); f := TFileStream.Create(OpenPictureDialog1.filename, fmOpenRead); m.CopyFrom(f, f.Size); s := AnsiUpperCase(ExtractFileExt(OpenPictureDialog1.FileName)); //Siempre en mayusculas if s = '.JPEG' then begin s:= '.JPG'; //un caso especial end; Table1FORMAFOTO.AsString:= Copy(s,2,3); //elimino el punto f.Free; m.Free; end; end; Y funciona correctamete para guardar, pero al recorrer por medio de una grilla y tratar desde un boton de mostrar la imagen asociada al registro utilizo el siguiente codigo : procedure TForm1.Button2Click(Sender: TObject); var m : TStream; begin if not (table1.state in [dsEdit,dsInsert]) then begin if Table1FOTO1.IsNull then begin Image1.Picture:= nil end else begin m := Table1.CreateBlobStream(Table1FOTO1, bmRead); if Table1FORMAFOTO.AsString = 'BMP' then begin Image1.Picture.Graphic:= TBitmap.Create end else begin if Table1FORMAFOTO.AsString = 'JPG' then begin Image1.Picture.Graphic:= TJpegImage.Create end else begin if Table1FORMAFOTO.AsString = 'GIF' then begin Image1.Picture.Graphic := TJpegImage.Create end; end; end; Image1.Picture.Graphic.LoadFromStream(m); m.Free; end; end; end; Este codigo genera un error : Non-blob column in table required to perform operation. Alguien me podria decir porque es o como lo arreglo, en lo que investigue parecia se problema de rol del usuario pero verificando este tiene rol de DBA, entonces descarte este caso al igual que la version del DBE que es 5.0 Gracias |
#2
|
|||
|
|||
sere burro che! no se q es table1formafoto.asstring.... :S creo q hay algo q no estas indicando..... el error donde esta? debugueaste??.... plisss se me as especifico
saludossss |
![]() |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
![]() |
|