我想在VBscript中創建ADODB.Stream對象。這是函數:無法創建對象:ADODB.Stream
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
當我嘗試運行這個功能我得到的錯誤:
Microsoft VBScript runtime error: ActiveX component can't create object: 'ADODB.Stream'
我需要做什麼,創建這個ADODB.Stream對象?
可能感興趣的:禁用流對象http://support.microsoft .com/kb/870669 – Fionnuala 2010-01-29 13:35:43