Domino 9 und frühere Versionen > ND6: Entwicklung

Feld im names.nsf ändern

(1/2) > >>

mgeidl:
Hallo,

wir haben bei uns InstallPump im Einsatz und möchten ein Feld im names.nsf (Arbeitsumgebung) mit diesem Tool ändern. Wir haben das Script umgeschrieben, aber leider wird das Feld nicht geändert, sondern neu (somit haben wir zwei) mit dem gewünschten Wert hinzugefügt.

Könnte sich BBBIIIITTTTTEEEEE wer erbarmen und das Script mal durchsehen, warum das so ist? DANKE und LG Marietta

Option Explicit
' this script loops through all of the location documents and sets the internet address to
' the value assigned to the "iaddress$" variable

Sub Main
   Dim NoteCount&, i&, ExhaustiveNameLockup$
   Dim LocationName$
   On Error GoTo main_err
   
   IPLogCreate "****************************************************"
   IPLogCreate "About to modify location documents"
   IPLogCreate "****************************************************"
   

   ExhaustiveNameLockup$ = "1"

   
   ' open the local NAB
   NoteCount& = IPNotesOpenView("", "NAMES.NSF", "($Locations)", "*")
   
   ' make sure that documents have been returned.
   If NoteCount& < 0 Then
      IPLogError "Unable to modify Location documents." + Chr$(13) + IPNotesGetLastError()
      Exit Sub
   End If
   
   'loop
   For i& = 0 To NoteCount& - 1
      If IPNotesOpenNote(i&) Then
         IPLogError "Unable to modify Location documents." + Chr$(13) + IPNotesGetLastError()
         IPNotesCloseDatabase
         Exit Sub
      End If
      
      ' find the current location name
      LocationName$ = IPStringLeft(IPNotesGetTextField(i&, "Name"), Chr$(0))
      'MsgBox "Editing location '" & LocationName$ & "'"
      
      IPNotesSetTextField i&, "ExhaustiveNameLockup", ExhaustiveNameLockup$
      

      IPNotesUpdateNote i&
      IPNotesCloseNote i&
   Next
   
   IPNotesCloseDatabase   
   IPNotesDisconnect()
   IPLogCreate "All Location documents updated sucessfully."
   
   Exit Sub
   main_err:
   IPLogCreate "Error modifying location documents:  " & Err.Number & " " & Err.Description
   Exit Sub
End Sub

klaussal:
Lass doch mal den Debugger mitlaufen und schau nach, wo + wie er das Feld ändert. Vielleicht gibt es da schon Auffälligkeiten(Gross-/Kleinschreibung, etc).

eknori:
Ich würde hier einmal den leicht zu erkennenden Tippfehler verantwortlich machen

klaussal:
 :P

mgeidl:
Hm, scheint, als müßt ich wieder mal zum Augenarzt, oder aber nur für Guru´s is der Tippfehler leicht zu erkennen??

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln