I am giving you code snippets that show you how to handle those two methods.
For inserting an image into database I have used an Image Control (let the name
Image1). First Select an Image and put it into the Image1 control on the form,
add a submit button, and write the following code:
rec.Open <database name>, con, adOpenKeyset, adLockOptimistic
rec.AddNew
Dim pp As New ADOPictDB32.ADOPictDB
Dim temp As String
temp = "picture.tmp"
If Image1.Picture <> 0 Then
SavePicture Image1.Picture, temp
pp.putPict rec, "pict", temp
Else
Exit Sub
End If
rec.Update
rec.Close
Set rec = Nothing
Comments