[edit] See Post # 35 for a solution on doing this without a temp file and without data binding
Go to post #35 -> http://www.vbforums.com/showpost.php...2&postcount=35
Ok - I've been loading pictures into an image control with LOADPICTURE like this:
with s1 being a string to the filepath and filename.Code:.imgImage.Picture = LoadPicture(s1)
Now we want to support storing pictures in our DB - and I got this code from looking at a thread by Si.
Here I'm calling a stored procedure to grab the image from a table in the database.Code:Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset rs.Open "Exec GetStuPhoto_P '" & s3 & "'", gCn Set .imgImage.DataSource = rs .imgImage.DataField = rs.Fields(0).Name rs.Close Set rs = Nothing
Do I need to use .DataSource - is that the only (and best) way to do this? I've never used the DataSource property before - it sounds like a "bound-control" and I'm worried about that.
Any other opinions on this code?
Thanks!




Reply With Quote