SQL数据库存的图片是二进制流 怎么取出来存到DataTable中并且显示图片
展开全部
Sub ReadPictureData(RS As ADODB.Recordset, ColName As String, PicturePath As String, PictureName As String)
'说明:从数据库读取图片二进制数据、转换成图片文件并存储;返回存储路径
Dim Stm As ADODB.Stream
Set Stm = New ADODB.Stream
Stm.Type = adTypeBinary
Stm.Open
Stm.Write RS.Fields(ColName).Value
Stm.SaveToFile PicturePath & "\" & PictureName & ".jpg", adSaveCreateOverWrite
Stm.Close
Set Stm = Nothing
End Sub
用adodb.stream
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询