From: Jeff Teal on
I am a QuickTest Pro developer, which uses vbscript. After creating the object for ADs.ArrayConvert, I need the syntax to actually convert the array and get the values. Microsoft's example did not help. I realize this was posted awhile ago, but hopefully you can still help. Thanks.

> On Thursday, August 09, 2007 5:42 PM A wrote:

> I have a DLL that I call that returns a string() - I know this because I do a
> VBScript test of typename and I also get 8200 when I do a vartype. I cannot
> modify this DLL at all. Please, does anyone know how to convert from this
> array of strings to an array of variants? The documentation says it is a
> variant array, but I think it must be made up of strings. I am able to do a
> IsArray and UBound with no error, but everytime I try to get an element, I
> get a type mismatch error. I have seen loads of posts on this problem, but
> no solution. They just say that VBScript cannot handle string arrays. Is
> there a solution yet?? I'm at the end of my rope. Thank you.


>> On Thursday, August 09, 2007 5:55 PM Paul Randall wrote:

>> Are you talking about a byte array? And do you want to convert this byte
>> array to a string?
>>
>> -Paul Randall


>>> On Thursday, August 09, 2007 7:29 PM Michael Harris \(MVP\) wrote:

>>> AW wrote:
>>>
>>> SAMPLE: ARRAYCONVERT.EXE Variant Conversion Functions
>>> <http://support.microsoft.com/kb/q250344/>
>>>
>>> --
>>> Michael Harris
>>> MVP - Admin Frameworks


>>>> On Friday, August 10, 2007 10:56 AM A wrote:

>>>> No, it is a variant array of strings, but I need it to be a variant array of
>>>> variants so I can access the elements in VBScript.
>>>>
>>>> "Paul Randall" wrote:


>>>>> On Friday, August 10, 2007 10:56 AM A wrote:

>>>>> Thank you for the link. I installed it and tried to create an object with:
>>>>> Set cnvt = CreateObject("ADs.ArrayConvert")
>>>>> and I get an error: ActiveX component can't create Object.
>>>>>
>>>>> I have registered it with regsvr32 and have checked the registry to see that
>>>>> it is there. I also am able to see it in visual studio to add it as a
>>>>> reference.
>>>>>
>>>>> Any ideas? Thank you very much.
>>>>>
>>>>> "Michael Harris (MVP)" wrote:


>>>>>> On Friday, August 10, 2007 3:59 PM Paul Randall wrote:

>>>>>> Hopefully you have it working by now.
>>>>>> I tried registering it and unregistering it a couple of times, which seeemed
>>>>>> to work.
>>>>>> I thought I had left it registered and tried this two-line script:
>>>>>>
>>>>>> Set cnvt = CreateObject("ADs.ArrayConvert")
>>>>>> MsgBox "Object succeeded"
>>>>>>
>>>>>> I had the same failure that you had.
>>>>>>
>>>>>> After unregistering and registering it a few more times, the createobject
>>>>>> statement now works.
>>>>>>
>>>>>> -Paul Randall
>>>>>>
>>>>>> "AW" <AW(a)discussions.microsoft.com> wrote in message
>>>>>> news:F0972C1A-FC87-438C-95F3-2C5F7FCB130B(a)microsoft.com...


>>>>>>> On Friday, August 10, 2007 4:16 PM A wrote:

>>>>>>> Paul, did you do ANYTHING different? I tried registering and unregistering
>>>>>>> multiple times like you did but I still get the same error.
>>>>>>>
>>>>>>> "Paul Randall" wrote:


>>>>>>>> On Friday, August 10, 2007 6:09 PM Paul Randall wrote:

>>>>>>>> I created a folder with four files in it:
>>>>>>>> 1. ADs.dll
>>>>>>>> 2. Register.bat, which contains two lines:
>>>>>>>> regsvr32 ads.dll
>>>>>>>> pause
>>>>>>>> 3. UnRegister.bat, which contains two lines:
>>>>>>>> regsvr32 /u ads.dll
>>>>>>>> pause
>>>>>>>> 4. Test.vbs, which contains two lines:
>>>>>>>> Set cnvt = CreateObject("ADs.ArrayConvert")
>>>>>>>> MsgBox "CreateObject succeeded"
>>>>>>>>
>>>>>>>> After running Register.bat one or more times, which always succeeds,
>>>>>>>> Test.vbs always creates the object.
>>>>>>>>
>>>>>>>> After running UnRegister.bat one or more times, which always succeeds,
>>>>>>>> Test.vbs always fails in line 1.
>>>>>>>>
>>>>>>>> Strange thing: my object browser, TLViewer, can't find ADs.ArrayConvert
>>>>>>>> whether Test.vbs creates the object or not.
>>>>>>>>
>>>>>>>> -Paul Randall
>>>>>>>>
>>>>>>>> "AW" <AW(a)discussions.microsoft.com> wrote in message
>>>>>>>> news:D7748650-519A-4B21-93D4-4FFE6B89E0D6(a)microsoft.com...


>>>>>>>>> On Monday, August 13, 2007 10:30 AM A wrote:

>>>>>>>>> I finally was able to run CreateObject successfully by changing my internet
>>>>>>>>> security permissions under Local Intranet (where my app runs) to prompt for
>>>>>>>>> unsafe ActiveX controls instead of just disabling. FINALLY!
>>>>>>>>>
>>>>>>>>> "Paul Randall" wrote:


>>>>>>>>>> On Monday, August 13, 2007 2:49 PM Paul Randall wrote:

>>>>>>>>>> Thanks for letting us know what the problem was.
>>>>>>>>>>
>>>>>>>>>> -Paul Randall


>>>>>>>>>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>>>>>>>>>> ComponentOne Studio for ASP.NET AJAX - Free License Giveaway
>>>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/ce98ce1f-2b5d-4ec8-b6d5-a1049651514e/componentone-studio-for-aspnet-ajax--free-license-giveaway.aspx
From: Mayayana on
One more thing:
It sounds like you paid for the QuickTest thing.
If it's really intended for use with VBS they should
have support and sample code available. You might
want to contact them directly.


From: Mayayana on
I have no idea what QuickTest is, but it doesn't
seem to be designed for VBS, given the trouble
you're having.

VB has a CVar method, but it doesn't seem to
exist in VBS. I downloaded the package you linked
to. It's an odd thing. It mentions VBS, but it's designed
for VB, and the sample code is in VB. Yet VB has no
need for those functions! And there's no documentation
included at all. It's not surprising that you
couldn't make sense of it. The files constitute a jumbled
collection of 2 VB projects and two project groups, which
seem to be designed solely for VB beginners using
ADODB. The only relevant part for you is the .bas file.
The .cls file is nonsense intended for beginners who
have VB and want to bypass ADs.dll.

The typelib for ADs.dll says the method is
CStrArray(vInArray as Variant Array) as Variant

The sample code is converting the return from a
database query: rs.fields(1).Value. I don't use ADODB,
but given the following code it looks like rs.fields(1).Value
is an array.
So you should be able to just do:

Dim A1
A1 = ADSObj.CStrArray(ProblemStringArray)

--------------------------------
|I am a QuickTest Pro developer, which uses vbscript. After creating the
object for ADs.ArrayConvert, I need the syntax to actually convert the array
and get the values. Microsoft's example did not help. I realize this was
posted awhile ago, but hopefully you can still help. Thanks.
|