Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Propertybag problem

Status
Not open for further replies.

Namlop

Programmer
Nov 8, 2002
36
NL
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.

rsResult is a global ADODB.recordset that has been
set to the right record before this function is called


Why can't i set the contents of the propertybag?

I love work.
I can just sit and look at it for hours.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top