Hi!
I am trying to create ADODB.Stream object in VBscript. This is the function:
Function ByteArray2Text(varByteArray)
'Convert byte array into a string with ADODB.Stream
'Data should be real plain text because binary data will be mangled
Dim byt
Const adTypeText = 2
Const adTypeBinary = 1
Set byt = CreateObject("ADODB.Stream")
byt.Type = adTypeBinary
byt.Open
byt.Write varByteArray
byt.Position = 0
byt.Type = adTypeText
byt.CharSet = "us-ascii"
ByteArray2Text = byt.ReadText
byt.Close
Set byt = Nothing
End Function
When I try to run this function i am getting error:
Microsoft VBScript runtime error: ActiveX component can't create object: 'ADODB.Stream'
What i need to do, to create this ADODB.Stream object?