ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Post to SQL Blob through ImageEnDBView

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
asim122 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
3   L A T E S T    R E P L I E S    (Newest First)
asim122 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
asim122 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
xequte 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