Scripting the ADO stream object 
Author Message
 Scripting the ADO stream object


Quote:

> I've seen 2 methods 2 make an 8209 array from VBScript, but
> they both involve objects, though both are from MS.

> 1) Using the Capicom Utilities object

> ' begin ex1
> set oUtl = createobject("CAPICOM.Utilities")
> arr = oUtl.BinaryStringToByteArray( oUtl.HexToBinary("11223344556677"))
> WScript.echo Vartype(arr), Ubound(arr)
> ' end ex1

> 2) using the ArrayConvert.exe sample see:
> ' Q250344 - SAMPLE: ARRAYCONVERT.EXE Variant Conversion Functions
> ' http://www.*-*-*.com/

> ' begin ex2.
> strHex = "112233441122334411223344"
> Set cnvt = CreateObject("ADs.ArrayConvert") 'ads.dll
> binArray = cnvt.CvHexStr2vOctetStr(strHex)
> WScript.echo VarType( binArray ), ubound( binArray )

> for nJ = 1 to Ubound( binArray)
>    sOut = sOut & hex(ascb(midb(binArray, nJ,1 ))) & vbCrLf
> next
>  WScript.echo sOut

> strKey = "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\"  & _
>  "Windows Script Host\MyJunk"
> set objRegistry = CreateObject("RegObj.Registry")
> set objRegKey = objRegistry.RegKeyFromString(strKey)
> oldcnt =objRegKey.Values.count
> objRegKey.Values.Add "test", (binArray), 3
> WScript.echo oldcnt, objRegKey.Values.count
> ' end ex2

> hagd,
> Mark Pryor
> TLViewer - turbo Object Browser
> http://www.*-*-*.com/ ~mpryor/tlviewer.htm
> ICQ 64329574
> Pgp KeyID: 0x1A966EC5

Thanks, Mark
This worked for me.
Sorry I didn't get back sooner - I've been away.

-Paul Randall



Sat, 26 Mar 2005 12:04:10 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ADO stream object and charset property and internet publishing

2. Probrem . ADO Stream - Command Object

3. ADO Stream Object??

4. Security problem with ADO Streaming Object

5. ADO Stream Object

6. ADO Stream Variant object

7. ADO Stream Object

8. Scripting the adodb.stream and msxml2.xmlhttp objects

9. DX9 - Playing a streaming sound from a memory stream (not file stream)

10. Using ADO/stream to upload image into SQL

11. ado stream question

12. ADO Stream Write

 

 
Powered by phpBB® Forum Software