473,725 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_AP PEND, "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 2382
"Mark B" <ma********@hot mail.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_AP PEND, "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_AP PEND, "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_AP PEND = 3.

"InstallKey s" 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******** ******@TK2MSFTN GP02.phx.gbl...
"Mark B" <ma********@hot mail.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_AP PEND, "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_AP PEND, "wbempath", Product & "|" & Key

Or:

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

Or:

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



"Mark B" <ma********@hot mail.comwrote in message
news:e0******** ******@TK2MSFTN GP04.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_AP PEND, "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_AP PEND = 3.

"InstallKey s" 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******** ******@TK2MSFTN GP02.phx.gbl...
>"Mark B" <ma********@hot mail.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_AP PEND, "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_AP PEND, "wbempath", New Object() { Product & "|" &
Key}

Aug 19 '08 #5
Thanks Mark,

Glad it helped :)

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

Thanks Group!

(This one did it...)

objOU.PutEX ADS_PROPERTY_AP PEND, "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
1760
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 following in a class method: return $successMsgArray;
8
10231
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 it is assigned a text literal?? HOW can I change the array value to upper case then? What other method exists for arrays? Ex: var GridArrayName1 = new Array(); GridArrayName1 = new Array ('test-value'); GridArrayName1 = GridArrayName1...
1
1994
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 the myVar string. The myVar string is obtained in my show document function: myVar = filename; In my mail document function:
11
1952
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) fails on its last line which is meant to assign the value of SplitB (a variant) the value of aSplit (an array dim'd as variant). That fails due to Type Mismatch. Anyone know how to get around this? Private Type MapiRecip Reserved As Long
8
4759
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. --------------------------------- PROGRAMME -------------------------------- /* K&R2 section 1.9 exercise 1.19
4
4339
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 "selectedValues" from next page for php variable this is my javascript code saved on "sendValue.js" file, <script> function updateRecordEntry(requestValue){
1
1657
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
3157
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 (calls_id INTEGER PRIMARY
4
4238
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 value from a form $_POST; say I assign a variable
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.