![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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. > 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||