Private Sub cmdAddToDatabase_Click()
On Error GoTo ErrHandler
Dim bytData() As Byte
Dim sFileName As String
sFileName = "Path and Name of your Picture for insert"
Open sFileName For Binary As #1
If FileLen(sFileName) = 0 Then
MsgBox "Your Message"
Close #1
Exit Sub
Else
ReDim bytData(FileLen(sFileName))
Get #1, , bytData
Close #1
With rsPic 'Assuming u have open your recordset
.AddNew
.Fields("EmployeePhoto").AppendChunk bytData
'Assuming EmployeePhoto is Field in Database with datatype as image
'Your Other Related Fields here
.Update
End With
End If
Exit Sub
ErrHandler:
MsgBox Str(Err.Number) + " : " + Err.Description, vbInformation
Err.Clear
End Sub