Error on writing image to MDB via ODBC greather than 512 bytes lazarus / 16-Databases ---------------------------------------------------------------------- abilal · 2011-10-11 14:09 Hi Guys, I am trying to Save an image (BMP) to MDB database via ODBC. The good thing is that I can do it for images with file size less then 512 bytes. When image size is greather than 512 bytes. I have ODBC Bind error (error screen is attached). Any idea to fix the error? my code is below: procedure TForm1.ToDBClick(Sender: TObject); var  BinStream: TMemoryStream; begin   BinStream := TMemoryStream.Create;   SQLQuery1.ReadOnly := false;   SQLQuery1.SQL.Text := 'SELECT Pictures FROM Demo WHERE ID=1';   SQLQuery1.Active   := True;   SQLQuery1.Open;    aImage.Picture.Bitmap.LoadFromFile('c:\temp\aaa.bmp');    aImage.Refresh;    aImage.Picture.Bitmap.SaveToStream(BinStream);    BinStream.Position:=0;    SQLQuery1.Edit;    TBlobField(SQLQuery1.FieldByName('Pictures')).Clear;    TBlobField(SQLQuery1.FieldByName('Pictures')).LoadFromStream(BinStr eam);    //Caption:= IntToStr(BinStream.Size);    SQLQuery1.Post;    SQLQuery1.ApplyUpdates;    SQLQuery1.Close;    SQLQuery1.Active := False;    BinStream.Free; end; ---------------------------------------------------------------------- LacaK · 2011-10-12 05:31 Can you please post here some test application, which will show this error ? ---------------------------------------------------------------------- abilal · 2011-10-12 07:10 I have attached a test project with test.MDB, test.bmp, test2.bmp files. Note that, the test project works well done with 12x12pixel test2.bmp ---------------------------------------------------------------------- Lacak2 · 2011-10-12 08:12 For me it works! also with test.bmp Which version of FPC/Lazarus do you use (I use FPC 2.7.1 on Win98/XP ) ? Can you test it with current snapshot ? ( ftp://ftp.freepascal.org/pub/lazarus/snapshots/ ) ---------------------------------------------------------------------- abilal · 2011-10-12 11:01 Well, About Lazarus says: Version #:0.9.30 Date: 2011-03-08 FPC Version: 2.4.2 SVN Revision: 29749 i386-win32-win32/win64 what is your ODBC verison? and do you have an MS Office installation? ---------------------------------------------------------------------- Lacak2 · 2011-10-12 12:13 I suspect that your problem is related to FPC version, from time of FPC 2.4.2 there was some fixes to TODBCConnection. ODBC version? - Default with Win98 or WinXP or Vista (I tested it on all 3 environments) MS Office? - Yes ---------------------------------------------------------------------- abilal · 2011-10-12 12:59 Thank you very much for your interest Upgrade to FPC 2.7.1 fixes the problem Now test-project works great for realy huge bmp files. Problem Solved! Cheers!