----- Original Message ----- From: Anu Rang To: advanced_delphi@yahoogroups.com Sent: Tuesday, May 20, 2008 12:52 AM Subject: [advanced_delphi] Loading a picture into a TblobField of the ADOTable for INSERT
I was trying to load a JPEG picture into a TblobField to insert into the database table. I do something like TblobField(Form1.ADOTable1.FieldByName(`Picture')).LoadFromFile (filename); I get error message `field is not in edit/update mode'. I would be interested to know if anyone else has had any such similar problem. Thanx Anu Rang, TotallyFreeEnergy Http://totallyfreeenergy.freehoxt.com ----------------------------- I usually write something like this: TB.Edit; try .... TB.Post; except TB.Cancel; MessageBox( 'something is missing here'... ); end; I think try..except doesn't add any byte to the resulting code. ?? I don't want to mislead you or anything, but have you try FireBird? It is the free version of Interbase, database server that comes with Delphi. There is an embedded version of the server. Usually you distribute it as library named gds32.dll, at minimal it is the only dll you need to distribute with your app. I haven't tried it yet, so this is a rather questionable suggestion. Don't know about FireBird, but Interbase has TBlobStream that makes it easier to work with blob field. FIreHAzaR:-D West Java, Indonesia