Jump to content

How to pass array using com object ?


HansH
 Share

Recommended Posts

I am trying to use a com object, but I need to pass an array.

Can't succeed in this somehow, so hopefully some one knows how.

Microsoft documentation says:

Set rs = cn.OpenSchema(adSchemaIndexes, _
         Array(Empty, Empty, Empty, Empty, "Employees")

I have the following code in autoit

Dim $arr[5] = [ "", "" , "", "", "employees" ]
$adSchemaIndexes=12
$adoRs = $adoCon.OpenSchema ($adSchemaIndexes, $arr )

But I get an COMerror 80020009

Any suggestions how to pass those array values ?

Link to comment
Share on other sites

You may just want to try doing $arr[5] = "Employees"

I believe there was a small discussion about initializing arrays in the beta as well, which may or may not be an issue (does it mean NULL when it says Empty?)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

You may just want to try doing $arr[5] = "Employees"

I believe there was a small discussion about initializing arrays in the beta as well, which may or may not be an issue (does it mean NULL when it says Empty?)

<{POST_SNAPBACK}>

Works ! You only must declare $arr[5]="Employees"

If you fill any of the other arrayfields with "" it will do nothing.

Const $adSchemaIndexes=12
Dim  $arr[5]
$arr[5]="Employees"
$adoRs = $adoCon.OpenSchema ($adSchemaIndexes, $arr )

Thx

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...