Groups > Novell > Novell ActiveX > Re: Auxiliary class and NWDir




Re: Auxiliary class and NWDir

Re: Auxiliary class and NWDir
Mon, 06 Aug 2007 16:04:43 GMT
I know this is incredibly old....but might anyone have the code snippet 
referred to below (back from 2001).

If so, I'll be incredibly grateful.

Thanks!

On 2003-01-23 17:25:04 -0500, "Tim Bailen" 
<timothybailen@[NOSPAM].alliantenergy.com> said:

> As of the most recent NDK, the documentation has not been corrected.
> 
> 
> "Wolfgang Schreiber" <DevForums@novell.com> wrote in
message
> news:9ijm43$93117@devforums.novell.com...
>> Dean,
>> 
>> your right - if you want to add a new value to an attribute set
> (like in
>> this case of adding an aux class) you definitely need to read the
> attribute
>> first, do the redim and addition, before saving the attribute back.
>> > ´This is especially true for the "Object Class"
attribute.  Every
> other
>> attempt to add an aux class would cause a schema violation.
>> 
>> Wolfgang Schreiber
>> Novell Worldwide Developer Support (EMEA)
>> 
>> Useful links:
>> http://developer.novell.com/ndk/sitemap.htm  NDK Site Map
>> http://developer.novell.com/support/sample.htm DevSup Sample Code
>> >   http://developer.novell.com/education   Developer Education
>> http://support.novell.com/forums   TechSup Forums
>> http://support.novell.com/search/kb_index.htm  TechSup
> Knowledgebase
>> 
>> "Dean" <1@1.net> wrote in message
> news:9ii99n$9398@devforums.novell.com...
>>> It appears that the sample snippit in the Help file for adding an
>>> > auxiliary
>>> class to a user object is not correct.  The snippit is:
>>> 
>>> Dim entry As NWEntry
>>> Set entry = NWDir1.FindEntry(txtEntry.Text)
>>> entry.SetFieldValue "Object Class",
"MyAuxClass"
>>> entry.SetFieldValue "Car", "some value"
>>> entry.SetFieldValue "Apartment", "some value"
>>> entry.Update
>>> 
>>> This code returns a -628 (attempt to add object without specifying
> the
>>> object's base class)
>>> 
>>> On 01/23/2001 Andrew asked this same question and later a user
> replied
>>> suggesting to follow his example.  The example provided first uses
> 
>>> GetFieldValue to get an array of existing object classes, then
> redims it
>> and
>>> adds the new one, and then uses SetFieldValue to add the array
> back to
> the
>>> entry object.  This seems to work fine, but just curious....is
> this the
>>> correct and only way?  I wonder if the 628 error is because the
>>> SetFieldValue is attempting to replace the entire collection of
> object
>>> classes rather than simply adding a new one, and thus it complains
> about
>> not
>>> having the "base class."
>>> 
>>> Thanks,
>>> Dean
Post Reply
about | contact