This appears to be .NET framework code. ByteImage = System.IO.File.ReadAllBytes("C:\my folder\my file")
Since I am not using .NET, is there equivalent code in VBA (Access 2007) that will do the same thing?
This appears to be .NET framework code. ByteImage = System.IO.File.ReadAllBytes("C:\my folder\my file")
Since I am not using .NET, is there equivalent code in VBA (Access 2007) that will do the same thing?
Perhaps:
''Reference: Microsoft ActiveX Data Objects x.x Library
Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.LoadFromFile "c:\docs\image.jpg" 'FileNameToLoadWithFullPath
You can easily add this to a recordset like so:
rs.AddNew
rs.Fields("ImageCol").Value = mstream.Read
rs.Update
Dim ByteImage() As Byte
Open "C:\my folder\my file" For Binary Access Read As #1
ReDim ByteImage(1 To LOF(1))
Get #1, , ByteImage
Close #1