Click here to Skip to main content
15,902,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm Using VBA MS ACCESS What is File Browser in this code ? where can i find it

Please Help ↓

actually i don't know what is the file browser ? is that reference or ActivX

What I have tried:

Private Sub LstFiles_DblClick(Cancel As Integer)
    If Not IsNull(Me.LstFiles) And Not Me.LstFiles = "" Then
        Dim myrs As New ADODB.Recordset
        Dim Stream As String, ImageData As String
        Dim binaryStream As New ADODB.Stream
        myrs.Open "SELECT * FROM tblFileStore WHERE FileID = '" & Me.LstFiles & "'", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
        'Specify stream type - we want To save binary data.
        binaryStream.Type = adTypeBinary
        'Open the stream And write binary data To the object
        binaryStream.Write myrs("FileData")
        binaryStream.SaveToFile "C:\"
        'Start HTML generation
        Stream = "<Html><head></head><body>"
        Stream = Stream & "<img src=" & """" & "data:image/" & myrs("filetype") & ";base64," & encodeBase64(binaryStream.Read) & """" & ">"
        Stream = Stream & "</body></html>"
        Me.FileBrowser.Document.Write Stream
        On Error Resume Next
            Set myrs = Nothing
        On Error GoTo 0
    End If
End Sub
Updated 12-Jan-21 20:43pm
F-ES Sitecore 6-Jan-21 13:21pm    
It will be something defined elsewhere on the form, maybe a control called FileBrowser.

1 solution

Without having an access to the project we can't tell what FileBrowser is.

I guess that it's a custom class or ActiveX component. I have found discussion about LstFiles_DblClick procedure in this thread: [SOLVED] Display Image from Binary data without writing to file[^], which seems to be exactly the same as yours.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900