VB,在access中存储图片路径、读取图片到picturerbox方法

2024-12-23 14:44:09
推荐回答(1个)
回答1:

image字段是用于储存二进制流Private m_objPicture As StdPicturePublic Function getSignaturePicture() As StdPicture
'---获得用户对应的签字图片
Dim objSQL As CSQL
'---存储临时文件名
Dim TempFile As String
Dim fso As New Scripting.FileSystemObject TempFile = App.Path & "\TempFile\TempSignature.JPG" If fso.FileExists(TempFile) Then
DeleteFile (TempFile)
End If

Set objSQL = New CSQL

With objSQL
.Table = "Pub_People"
.Field("SignaturePicture") = ""
.Key("People_No") = m_UserCode Call g_objDB.ReadBinDataToFile(objSQL, TempFile)
If fso.FileExists(TempFile) Then
Set getSignaturePicture = LoadPicture(TempFile)
Else
MsgBox "没有上传签字图片"
Set getSignaturePicture = Nothing
Exit Function
End If End With
End Function