I would like to store the file on to the database. How can I code it in visual basic to store it as byte stream. This is the code I have to browse for the directory. I would also like the code to allow me to seelct files not the whole directory.
Private Sub Command1_Click( )
'Opens a Treeview control that displays the directories in a computer
Command1.Visibl e = True
Dim lpIDList As Long
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo
szTitle = "File to Upload:"
With tBrowseInfo
.hWndOwner = Me.hWnd
.lpszTitle = lstrcat(szTitle , "")
.ulFlags = BIF_RETURNONLYF SDIRS + BIF_DONTGOBELOW DOMAIN
End With
lpIDList = SHBrowseForFold er(tBrowseInfo)
If (lpIDList) Then
sBuffer = Space(MAX_PATH)
SHGetPathFromID List lpIDList, sBuffer
sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
'Text1.Text = sBuffer
txtFields(14).T ext = sBuffer
MsgBox sBuffer
End If
Comment