Autor Thema: 210 - Automation object member not found  (Gelesen 18703 mal)

Glombi

  • Gast
Re:210 - Automation object member not found
« Antwort #20 am: 23.09.04 - 21:17:39 »
Der Vollständigkeit halber hier der Auszug aus der KBASE. Es hat nicht wirklich was mit OLE direkt zu tun.

LotusScript code that accesses a third party object (a non-Lotus object) results in the following error when calling methods which contain no parameters:

"Automation object member not found."

The same code logic works within Visual Basic without error.

The following code sample demonstrates this issue.  The below code runs on Windows systems to access the Assigned Directories Services (ASDi) object.  When the Members method is called, the error occurs:

 Dim Group
 Dim Member
 
               ' Bind to a known group object.
 Set Group = GetObject("WinNT://ComputerName/Administrators")
 Set member = Group.Members  'The code will error when executing this line

 Forall x In member  
  Print x.name
 End Forall
 
 Msgbox  group.name  ' Returns "Administrators"
 Msgbox group.class  ' Returns "Group"
 Msgbox group.AdsPath ' Returns "WinNT://Domain/ComputerName"
 
 If Group.IsMember("WinNT://Domain/ComputerName/csmith") Then
  Msgbox "Already a Member"
 Else
  group.Add("WinNT://ComputerName/csmith")
 End If




LotusScript requires the use of parentheses when calling the methods of non-Lotus objects, even when the methods do not have any parameters.  

From the example above, the Members method call would be made as follows:

Set member = Group.Members()

Within Notes, when working with Notes objects it is recommended, but not required, to use parentheses when calling a method that does not contain any parameters.

For example, both of the following calls to GetFirstDocument (of the NotesDocumentCollection class) run without error:

Set doc = collection.getfirstdocument

Set doc = collection.getfirstdocument()

Supporting Information:

A directory service is basically a database that contains the attributes and locations of shared objects connecting the network.  Users that want to access these resources may do so by using a special syntax.  An assigned directory service uses a syntax which is called a namespace.  For example, //CompanyName/csmith would identify a workstation and a logged-in user.  The collection of all workstations and users on the network can be accessed this way from a namespace.  A directory service provides a method to manage the data stored in internal tables.  You can read and set security flags and descriptions.

The ability to access and/or update the Active Directories depends on the ADSi object control and is available through COM.  

It is also important when using the IsMember method, that the complete ADsPath is used.

Related Documents:

Setting Third-Party Object Property to an Object Causes Error: "Automation Object Member Not Found"
Document #:  1084270

Offline zhermann

  • Aktives Mitglied
  • ***
  • Beiträge: 129
  • Geschlecht: Männlich
  • Wenn Notes es kann, kann ich es auch!
    • Factory system
Re:210 - Automation object member not found
« Antwort #21 am: 24.09.04 - 06:54:02 »
Hallo Bernhard,

hier der erstcode.

Function dokcounter
   
   Dim ProgLevel As Integer
   
   Counter = Counter + 1
   ProgLevel = Round( ( Counter * 100 / FileCounter ), 0)
   dokcounter = ProgLevel

End Function

Ich habe den Automation Error in der Zeilt ProgLevel = ... bekommen.

Gruß

Zsolt

Offline DaemoN

  • Frischling
  • *
  • Beiträge: 40
  • Geschlecht: Männlich
  • Shiny!
    • [KOEBS] 4.0 - Männerhort und Freundschaft seit Jahrzehnten
Re: 210 - Automation object member not found
« Antwort #22 am: 12.09.11 - 15:51:11 »
dieses thema ist zwar schon viele jahre alt, hat mir aber heute nach stunden erfolglosen versuchen die lösung gebracht. hatte auch das problem dass object.Members zwar in VB script funktioniert, nicht aber in LN script. dass die lösung mit object.Members() derart simpel ist, hätte ich nicht gedacht.

ein dankeschön an das notes forum und dessen member welche mir wieder einmal weiterhelfen konnten!  8) :love:
Eins, zwei oder drei, letzte Chance vorbei! Ob ihr wirklich richtig steht, seht ihr wenn das Licht angeht ...

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz