VB 怎么样把图片存到ACCESS数据库里,然后再有数据库读取???谢谢了,把代码给我些出来吧!!!
2个回答
展开全部
Private Sub FileToField(ByVal cFileName As String, ByVal oField As adodb.Field)
'将文件数据传递给adodb.Field对象
Dim FileData() As Byte
Dim intFileNo As Integer
intFileNo = FreeFile()
Open cFileName For Binary As #intFileNo
ReDim FileData(LOF(intFileNo))
Get #intFileNo, , FileData
Close #intFileNo
oField.Value = FileData
Erase FileData
End Sub
Private Sub FieldToFile(ByVal cFileName As String, ByVal oField As adodb.Field)
Dim FileData() As Byte
Dim intFileNo As Integer
ReDim FileData(oField.ActualSize - 1)
FileData() = oField.Value 'rst.Fields(2).Value
intFileNo = FreeFile()
Open cFileName For Binary As #intFileNo
Put #intFileNo, , FileData()
Close #intFileNo
Erase FileData
End Sub
'将文件数据传递给adodb.Field对象
Dim FileData() As Byte
Dim intFileNo As Integer
intFileNo = FreeFile()
Open cFileName For Binary As #intFileNo
ReDim FileData(LOF(intFileNo))
Get #intFileNo, , FileData
Close #intFileNo
oField.Value = FileData
Erase FileData
End Sub
Private Sub FieldToFile(ByVal cFileName As String, ByVal oField As adodb.Field)
Dim FileData() As Byte
Dim intFileNo As Integer
ReDim FileData(oField.ActualSize - 1)
FileData() = oField.Value 'rst.Fields(2).Value
intFileNo = FreeFile()
Open cFileName For Binary As #intFileNo
Put #intFileNo, , FileData()
Close #intFileNo
Erase FileData
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询