'Here Image1 is the image control Placed in the form
Private Sub ShowImage(ByVal intRow As Integer, ByVal intCol As Integer)
Dim rs As ADODB.Recordset
Dim obj As clsPict
On Error GoTo CErr
If Me.grdSearch.Cell(flexcpText, intRow, intCol) <> "" Then
Set obj = New clsPict
Set rsI = New ADODB.Recordset
Set strStream = New ADODB.stream
Set rsI = New ADODB.Recordset
Set rsI = obj.getPicture("PictCode")))
strStream.Type = adTypeBinary
strStream.Open
strStream.Write rsI("picture")
strStream.SaveToFile "C:\Temp.bmp", adSaveCreateOverWrite
Image1.Picture = LoadPicture("C:\Temp.bmp")
Me.grdSearch.Cell(flexcpPicture, Row, 6) = Image1.Picture
Me.grdSearch.Cell(flexcpPictureAlignment, Row, 6) = 9
Exit Sub
CErr:
msgbox( Err.Description)
End Sub
No comments:
Post a Comment