how exactly read blob field lazarus / 16-Databases ---------------------------------------------------------------------- deepblue · 2009-08-24 11:52 i have a table with blob field..this field is for picture. i have try to SQLdb and TDBImage component but it doesn't work. my step is: 1. add SQLConnector. I set Connected to true and no error 2. add SQLQuery1. I set SQL with 'select * from product order by code'. and active property to true. no error 3. i double click in SQLQuery. I do Add Fields in 'Edit Fields - SQLQuery1'..i add 'picture' field as TBlobField. the problem is: i choose that tblobfield and i saw strange Blobtype property (under Alignment in Object Inspector).. that property's combobox shows: three empty space,??,??,{,Dataset,ef4V ?,ftFixedWideChar,ftFMTBcd,ftGuid,ftIDispacth,ftInterface,ftOraBlob,ft OraClob,ftTimeStamp,ftvariant,ftWideMemo,TdatasetNotifyEvent. CMIIW, it should be 'TBlobType = ftBlob..ftWideMemo;' (i saw in db.pas line 791) is there a bug in FPC or LCL? i tried to set SQLQuery1picture.BlobType:=ftGraphic; in form create procedure but it's doesn't show picture in tdbimage.. NB:I have same condition with Zeos please help me.. thanks.. My Lazarus Version:Lazarus 0.9.29 r21262:21406M FPC 2.3.1 i386-win32-win32/win64 ---------------------------------------------------------------------- Loesje · 2009-08-25 16:19 The format of the data in the blob-field has to be recognized by TDBImage. Try to add a picture in TDBImage, then write it to the database and then open it again. That way you know for sure that the format is ok. (Just binary data with a .gif or something won't work. It needs a header with the image-type) ---------------------------------------------------------------------- halityilmaz · 2010-08-25 08:39 this is not aout your question, i know and i am sorry but i want to ask you what you used for ConnectorType Property of SqlConnector? I have ( unknown connector type) error every time when i want to connect to the sql server. thank you. ---------------------------------------------------------------------- guidoaerts · 2010-08-27 07:08 this is an example: var fstream : tStream; fgraph : tjpegimage;    begin  if not (tblobfield(fieldbyname('foto')).IsNull) then      begin         fstream := gquery.CreateBlobStream(gquery.FieldByName('foto'),bmread);         fgraph := tjpegimage.create;         try           fgraph.LoadFromStream(fstream);           fotoimage.Picture.Assign(fgraph);         finally           fstream.free;           fgraph.free;         end;      end;              end; ---------------------------------------------------------------------- Lacak2 · 2010-08-31 05:43 Quote from: halityilmaz on August 25, 2010, 10:39:28 amthis is not aout your question, i know and i am sorry but i want to ask you what you used for ConnectorType Property of SqlConnector? I have ( unknown connector type) error every time when i want to connect to the sql server. It depends on type of SQL Server you are connecting to. For example: ODBC: 'ODBC' Oracle: 'Oracle' MySQL: 'MySQL 4.1', 'MySQL 5.0' Interbase, Firebird: 'Firebird' etc. But you can use instead of SQLConnector some of individual SQLConnections (TODBCConnection,TOracleConnection,...) objects when you know to which SQL Server you want connect to.