Set mRsPic = New ADODB.Recordset
mRsPic.Open "select * from img where id='001'", gcnnData, 1, 3
If mRsPic.RecordCount > 0 Then
Set mStmPic = New ADODB.Stream
With mStmPic
.Mode = adModeReadWrite
.type = adTypeBinary
.Open
.Write mRsPic("photo")
.SaveToFile mStrPicPath
End With
End If
Sub ShowPic(szFile As String, szpicture As PictureBox)
On Error Resume Next
Dim w As Integer, h As Integer
Dim goPic As picture
Dim Pict As picture
If IsFileExist(szFile) Then
Set goPic = LoadPicture(szFile)
If goPic.Width > goPic.Height Then
If goPic.Width > szpicture.ScaleWidth Then
w = szpicture.ScaleWidth
Else
w = goPic.Width '玂ㄓ
End If
h = w * goPic.Height \ goPic.Width
Else
If goPic.Height > szpicture.ScaleHeight Then
h = szpicture.ScaleHeight
Else
h = goPic.Height
End If
w = h * goPic.Width \ goPic.Height
End If
End If
szpicture.Cls
szpicture.PaintPicture goPic, 0, 0, w, h
szpicture.ToolTipText = szFile
Set goPic = Nothing
End Sub