Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Object.Get vs direct retreival

Reply
 
Old 05-04-2009   #1 (permalink)
Tim Munro


 
 

Object.Get vs direct retreival

Hi all, I have a question relating to object propery caches and retreival
and update methods.

What is the difference between let's say:

sInfo = oUser.get("info") and
sInfo = oUser.info?

If the property does not exist in the cache, do they both return the
E_ADS_PROPERTY_NOT_FOUND code?
In each case will sinfo be "Empty" or "Null"?
Which is the proper method to use and which is the preferred method to use?

Similar questions for the .put method. If the property does not exist in the
cache and you need to create it, what's the proper way to do so?

Thanks very much
--
Tim.



My System SpecsSystem Spec
Old 05-04-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Object.Get vs direct retreival


"Tim Munro" <Excelsior@xxxxxx> wrote in message
news:uGjgHuOzJHA.2324@xxxxxx
Quote:

> Hi all, I have a question relating to object propery caches and retreival
> and update methods.
>
> What is the difference between let's say:
>
> sInfo = oUser.get("info") and
> sInfo = oUser.info?
>
> If the property does not exist in the cache, do they both return the
> E_ADS_PROPERTY_NOT_FOUND code?
> In each case will sinfo be "Empty" or "Null"?
> Which is the proper method to use and which is the preferred method to
> use?
>
> Similar questions for the .put method. If the property does not exist in
> the cache and you need to create it, what's the proper way to do so?
>
> Thanks very much
> --
> Tim.
>
If you use oUser.Get("info"), an error is raised (property cannot be found
in cache) if no value is assigned. If you use

sInfo = oUser.info

then sInfo will be Empty if info has no value. Otherwise, they are the same.
If you use Get you almost need to trap errors. I seldom use it as a result.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 05-05-2009   #3 (permalink)
Tim Munro


 
 

Re: Object.Get vs direct retreival

Thank you Richard.

"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
message news:uD4NS8OzJHA.1372@xxxxxx
Quote:

>
> "Tim Munro" <Excelsior@xxxxxx> wrote in message
> news:uGjgHuOzJHA.2324@xxxxxx
Quote:

>> Hi all, I have a question relating to object propery caches and retreival
>> and update methods.
>>
>> What is the difference between let's say:
>>
>> sInfo = oUser.get("info") and
>> sInfo = oUser.info?
>>
>> If the property does not exist in the cache, do they both return the
>> E_ADS_PROPERTY_NOT_FOUND code?
>> In each case will sinfo be "Empty" or "Null"?
>> Which is the proper method to use and which is the preferred method to
>> use?
>>
>> Similar questions for the .put method. If the property does not exist in
>> the cache and you need to create it, what's the proper way to do so?
>>
>> Thanks very much
>> --
>> Tim.
>>
>
> If you use oUser.Get("info"), an error is raised (property cannot be found
> in cache) if no value is assigned. If you use
>
> sInfo = oUser.info
>
> then sInfo will be Empty if info has no value. Otherwise, they are the
> same. If you use Get you almost need to trap errors. I seldom use it as a
> result.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Inherit from usercontrol - Object not set to instance of an object .NET General
datalist -- Object reference not set to an instance of an object. .NET General
Testing object arrays using Compare-Object and -contains PowerShell
Adding canonical aliases for Compare-Object, Measure-Object, New-Object PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46