Domino 9 und frühere Versionen > Entwicklung

db öffnen

(1/3) > >>

my head:
wie öffne ich eine datenbank mit script damit ich darin etwas suchen kann?

ich hab den namen und will in der anderen db anhand des namens eine tel-nr finden...

Performance:
dim db as NotesDatabase
Set db = New NotesDatabase(dbServer, dbPath )

suchen mit der Funktion  db.search


ist alles in der Hilfe sehr gut beschrieben  ;)


cu

my head:
wenn ich mit einer collection dann durch alle dokumente gehe, brauch ich ne schleife...

do while doc <>""
 ....
loop

funktioniert nicht... was brauch ich da??

MisterDa:
Set doc = documentCollection.GetFirstDocument
...
While Not (doc Is Nothing)
               .....
   Set doc = documentCollection.GetNextDocument(doc)
Wend

Sollte funktionieren

Gruß
MisterDa

my head:
ich habe das ganze so gelöst... krieg aber immer die meldung "type mismatch" beim ausführen


Sub Initialize
   'Variablendeklarationen für AKD-TelefonDB
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim view As NotesView
   Dim collection As NotesViewEntryCollection
   Dim doc As NotesDocument
   Dim entry As NotesViewEntry
   'Variablendeklarationen für DB "alle Nummern"
   Dim srcDb As NotesDatabase
   Dim srcView As NotesView
   Dim srcCollection As NotesViewEntryCollection
   Dim srcDoc As NotesDocument
   Dim srcEntry As NotesViewEntry
   'Variablenbelegung für AKD-TelefonDB   
   Set db = session.CurrentDatabase
   Set view = db.GetView("uebersicht")
   Set collection = view.AllEntries
   'Variablenbelegung für DB "alle Nummern"
   Set srcDb = New NotesDatabase("","names.nsf")
   Set srcView = srcDb.GetView("People")
   Set srcCollection = srcview.AllEntries
   'Variablenbelegung zum "Suchen"
   Set entry = collection.GetFirstEntry()   
   Set doc = entry.Document
   Set srcEntry = srcCollection.GetFirstEntry()   
   Set srcDoc =srcEntry.Document
   While Not (doc Is Nothing)
      If doc.nmbTel = "" Then
         If doc.txtNachname = srcDoc.LastName Then
            If doc.txtVorname = src.FirstName Then
               doc.nmbTel = srcDoc.OfficePhoneNumber
            Else
               Set srcEntry = srcCollection.GetNextEntry(SrcEntry)
               Set srcDoc =srcEntry.Document
            End If
         Else
            Set srcEntry = srcCollection.GetNextEntry(srcEntry)
            Set srcDoc =srcEntry.Document
         End If
      End If
      Set entry = collection.GetNextEntry(entry)
      Set doc = entry.Document
   Wend
End Sub

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln