Author |
Topic  |
|
asim122
Saudi Arabia
3 Posts |
Posted - Jul 02 2012 : 07:53:52
|
Hi,
I am using the following code to post the SQL server blob field through ImageEnDBView in Delphi 5
aStream:=cdsAvDocDetail.CreateBlobStream(cdsAvDocDetail.FieldByName('avImage'), bmWrite); ImageEnDBView.Io.SaveToStreamBMP(aStream); cdsAvDocDetail.Post; aStream.Free;
and to retrive
aStream:=cdsAvDocDetail.CreateBlobStream(cdsAvDocDetail.FieldByName('avImage'), bmRead); ImageEnDBView.IO.LoadFromStreamBMP(aStream); aStream.Free; ImageEnDBView.IO.Update;
It isn't working and blob is being posted as null, with either AutoDisplay set to True or False, Please help.
Regards, Asim |
|
xequte
    
39109 Posts |
Posted - Jul 02 2012 : 19:10:33
|
Hi
Before calling LoadFromStreamBMP you should reset the stream position:
aStream.Position := 0;
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
asim122
Saudi Arabia
3 Posts |
Posted - Jul 02 2012 : 23:07:42
|
Thanks Nigel,
But the main problem is that, the image field is not being updated, it keeps null, so retrieval would be the subsequent aspect, had added the retrival code just for completeness.
Regards, Asim |
 |
|
asim122
Saudi Arabia
3 Posts |
Posted - Jul 03 2012 : 02:33:50
|
Thanks Nigel,
It has been resolved wirhout the need of streams, the problem was with the code that had been setting DataSource:= nil for ImageEn control when files were to be saved to physical location.
Regards, Asim |
 |
|
|
Topic  |
|
|
|