My program is giving the following error:
Run-time error '5':
Invalid procedure call or argument
It happens when in the following code:
Private Function GetImage() As Picture
Dim BinaryData() As Byte
Dim mstream As ADODB.Stream
Dim pb As PropertyBag
Dim picPicture As Picture
Dim lngSize As Long
Set pb = New PropertyBag
Set mstream = New ADODB.Stream
pb.WriteProperty "Picture", picPicture
BinaryData = pb.Contents
mstream.Type = adTypeBinary
mstream.Open
mstream.Write rsResult("DVD_HOES".Value
mstream.Position = 0
BinaryData = mstream.Read
pb.Contents = BinaryData
Set GetImage = pb.ReadProperty("Picture"
End Function
The redline is the one giving the problem.
[sub]
rsResult is a global ADODB.recordset that has been
set to the right record before this function is called [/sub]
Why can't i set the contents of the propertybag?
I love work.
I can just sit and look at it for hours.
Run-time error '5':
Invalid procedure call or argument
It happens when in the following code:
Private Function GetImage() As Picture
Dim BinaryData() As Byte
Dim mstream As ADODB.Stream
Dim pb As PropertyBag
Dim picPicture As Picture
Dim lngSize As Long
Set pb = New PropertyBag
Set mstream = New ADODB.Stream
pb.WriteProperty "Picture", picPicture
BinaryData = pb.Contents
mstream.Type = adTypeBinary
mstream.Open
mstream.Write rsResult("DVD_HOES".Value
mstream.Position = 0
BinaryData = mstream.Read
pb.Contents = BinaryData
Set GetImage = pb.ReadProperty("Picture"
End Function
The redline is the one giving the problem.
[sub]
rsResult is a global ADODB.recordset that has been
set to the right record before this function is called [/sub]
Why can't i set the contents of the propertybag?
I love work.
I can just sit and look at it for hours.