473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Array(Value & "|" & Value2) from VB6 to VB.Net 2008

Hi experts,

I'm converting a homebrew AD management progam I wrote, from VB6 to VB 2008.

I've got some code that sticks values in to Active Directory like this:-

objOU.PutEx ADS_PROPERTY_APPEND, "wbempath, Array(Product & "|" and Key)

Basically, a convenient place for me to store and manage CD installation
keys.

In VB6, the 'Array' bit works fine.

VB 2008 spits it out. "'Array' is a type and cannot be used as an
expression."

What is the equivalent syntax in VB 2008?

Thanks,

Mark B

Aug 18 '08 #1
5 2356
"Mark B" <ma********@hotmail.comschrieb:
I'm converting a homebrew AD management progam I wrote, from VB6 to VB
2008.

I've got some code that sticks values in to Active Directory like this:-

objOU.PutEx ADS_PROPERTY_APPEND, "wbempath, Array(Product & "|" and Key)
There's something wrong with the code above, it won't even compile in VB6.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 18 '08 #2
Sorry, you've got to have a reference to Active DS Type library.

....

Set objou = GetObject("LDAP://CN=InstallKeys," & MyDomain)

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", Array(Product & "|" & Key)

ObjOu.SetInfo

Set objOU = Nothing

....

The "MyDomain" bit is the FQDN of my domain. (DC=MySite, DC=GOV, DC=AU),
etc.

ADS_PROPERTY_APPEND = 3.

"InstallKeys" is a container node in the root of my Active Directory (a
contact).

Product = "Windows XP SP2 Integrated" or some other string that the key is
for.

The pipe -"|" is used to delimit the product and the key, when reading back
the info later.

The key is the installation key or code.

Notice also I had a missing " at the end of "wbempath".

Apologies.

Mark

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:e0**************@TK2MSFTNGP02.phx.gbl...
"Mark B" <ma********@hotmail.comschrieb:
>I'm converting a homebrew AD management progam I wrote, from VB6 to VB
2008.

I've got some code that sticks values in to Active Directory like this:-

objOU.PutEx ADS_PROPERTY_APPEND, "wbempath, Array(Product & "|" and Key)

There's something wrong with the code above, it won't even compile in VB6.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Aug 18 '08 #3
Hi Mark,

Array(Product & "|" & Key) is a single element array with a single string
value. I'd try :

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", Product & "|" & Key

Or:

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", New String() { Product & "|" &
Key}

Or:

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", New Object() { Product & "|" &
Key}



"Mark B" <ma********@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP04.phx.gbl...
Sorry, you've got to have a reference to Active DS Type library.

...

Set objou = GetObject("LDAP://CN=InstallKeys," & MyDomain)

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", Array(Product & "|" & Key)

ObjOu.SetInfo

Set objOU = Nothing

...

The "MyDomain" bit is the FQDN of my domain. (DC=MySite, DC=GOV, DC=AU),
etc.

ADS_PROPERTY_APPEND = 3.

"InstallKeys" is a container node in the root of my Active Directory (a
contact).

Product = "Windows XP SP2 Integrated" or some other string that the key is
for.

The pipe -"|" is used to delimit the product and the key, when reading
back the info later.

The key is the installation key or code.

Notice also I had a missing " at the end of "wbempath".

Apologies.

Mark

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:e0**************@TK2MSFTNGP02.phx.gbl...
>"Mark B" <ma********@hotmail.comschrieb:
>>I'm converting a homebrew AD management progam I wrote, from VB6 to VB
2008.

I've got some code that sticks values in to Active Directory like this:-

objOU.PutEx ADS_PROPERTY_APPEND, "wbempath, Array(Product & "|" and Key)

There's something wrong with the code above, it won't even compile in
VB6.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Aug 19 '08 #4
You guys (and Bill, especially) are just freakin legends!

Thanks Group!

(This one did it...)

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", New Object() { Product & "|" &
Key}

Aug 19 '08 #5
Thanks Mark,

Glad it helped :)

"Mark B" <ma********@hotmail.comwrote in message
news:ez**************@TK2MSFTNGP05.phx.gbl...
You guys (and Bill, especially) are just freakin legends!

Thanks Group!

(This one did it...)

objOU.PutEX ADS_PROPERTY_APPEND, "wbempath", New Object() { Product & "|"
& Key}
Aug 19 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
$successMsgArray = array('image' => array('add_album' => 'Album: "$album" has been created', 'edit_album' => 'Information for album "$album" has been changed')); I am having to return the...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
1
by: JAG | last post by:
I am getting an error using the replace method in one of my functions. I am using the replace method in the mail document function in my frameset .hta to change forward slashes to back slashes in...
11
by: MLH | last post by:
The following procedures found at http://ffdba.com/downloads/Send_Mail_With_Outlook_Express.htm are meant to work together in harmony to effect eMail sends via OE. The last procedure (FN SplitB)...
8
by: arnuld | last post by:
i have created a solutions myself. it compiles without any trouble and runs but it prints some strange characters. i am not able to find where is the trouble. ...
4
by: IRC | last post by:
hey, i am pretty new on javascript as well as PHP, Hey, anyone can you help me, how to pass the javascript array value to php page......... i want to retrieve the values which are arrayed on...
1
by: vinodkus | last post by:
dear sir/madam I want to show javascript array value in asp combo. please help me or give me a proper link. Thanks in Advance. Bye
4
by: Gilles Ganault | last post by:
Hello I'm puzzled as to why PHP (5) prints this (under FreeBSD 6.3): ========= #!/usr/local/bin/php <?php $dbh = new PDO("sqlite:test.sqlite"); $sql = "CREATE TABLE IF NOT EXISTS calls...
4
by: toadstool | last post by:
I have an array containing the various products $inventory = array(); $inventory = "whatever1"; etc I have an array containing various values $quantity = array(100,200,300); I call in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.