| Sub ServerVergleichNewDok_V2 |
| On Error Goto ERRORSTEP |
| |
| |
| Dim workspace As New NotesUIWorkspace |
| Dim session As New NotesSession |
| |
| |
| Dim uidoc As NotesUIDocument |
| Dim doc As NotesDocument |
| Dim db As NotesDatabase |
| Set db = session.CurrentDatabase |
| |
| Set uidoc = workspace.CurrentDocument |
| Set doc = uidoc.Document |
| Dim s2 As Integer |
| |
| If doc.Server1(0) <> "" And doc.Server2(0)<> "" And doc.Server1(0) <> doc.Server2(0) Then |
| Print "Vergleich der Server gestartet!" |
| |
| Dim DBDir1 As New NotesDbDirectory(doc.Server1(0)) |
| Dim DBDir2 As New NotesDbDirectory(doc.Server2(0)) |
| Dim DB1Dir As NotesDatabase |
| Dim DB1 As NotesDatabase |
| Dim DB2 As NotesDatabase |
| Dim Item1 As Notesitem |
| Dim Item2 As Notesitem |
| |
| Dim intRCS1 As Integer |
| Dim lngDBHandleS1 As Long |
| Dim intRCS2 As Integer |
| Dim lngDBHandleS2 As Long |
| |
| Dim i As Integer |
| Dim DocNew As NotesDocument |
| Dim docCol As NotesDocumentCollection |
| |
| Set DB1Dir = DBDir1.GetFirstDatabase(1246) |
| |
| Print "Lade Daten vom Server " & Cstr(DB1Dir.Server) |
| |
| i = 0 |
| If Not db1Dir Is Nothing Then |
| Do Until db1Dir Is Nothing |
| |
| Set DB1 = New NotesDatabase(DB1Dir.server,DB1Dir.filename) |
| |
| Set DocNew = db.CreateDocument |
| DocNew.Form = "mDB" |
| |
| DocNew.Server1 = db1.Server |
| DocNew.TitelS1 = db1.Title |
| DocNew.PfadS1 = db1.FilePath |
| DocNew.ReplikIDS1 = Cstr(db1.ReplicaID) |
| DocNew.groesseS1 = Cstr(db1.Size) |
| DocNew.AnzahlS1 = Cstr(db1.AllDocuments.Count) |
| |
| DocNew.TitelS2 = "N.V." |
| DocNew.PfadS2 = "N.V." |
| DocNew.ReplikIDS2 = "N.V." |
| DocNew.groesseS2 = "N.V." |
| DocNew.ErstelltS2 = "N.V." |
| DocNew.GeaendertS2 = "N.V." |
| DocNew.FixUpS2 = "N.V." |
| DocNew.ANzahlS2 = "N.V." |
| Set DB2 = DBDir2.GetFirstDatabase(1246) |
| DocNew.Server2 = db2.Server |
| s2 = 0 |
| Print "Suche auf Server 2 nach Datenbank" |
| Do Until db2 Is Nothing |
| If db1.FilePath = db2.FilePath Then |
| Print "Datenbank gefunden - Trage Werte ein" |
| Set DB2 = New NotesDatabase(DB2.server,DB2.filename) |
| DocNew.TitelS2 = db2.Title |
| DocNew.PfadS2 = db2.FilePath |
| DocNew.ReplikIDS2 = Cstr(db2.ReplicaID) |
| DocNew.groesseS2 = Cstr(db2.Size) |
| DocNew.AnzahlS2 = Cstr(db2.AllDocuments.Count) |
| Exit Do |
| End If |
| s2 = s2 +1 |
| If s2 >= 10 Then Exit Do |
| Set db2 = dbdir2.GetNextDatabase() |
| Loop |
| |
| DocNew.Status = "Abgeschlossen" |
| Call DocNew.Save(True,False) |
| Set DB1 = Nothing |
| i = i +1 |
| If i >= 3 Then Exit Do |
| |
| |
| Print "Nächste Datenbank auf Sersve 1" |
| Set db1Dir = dbdir1.GetNextDatabase() |
| Sleep(10) |
| Loop |
| End If |
| |
| Print "Vergleich der Server erfolgreich beendet!" |
| Else |
| Messagebox ("Bitte geben Sie 2 verschiedene Server ein die miteinander verglichen werden sollen.") |
| End If |
| |
| Exit Sub |
| ERRORSTEP: |
| If Err = 4060 Then Resume Next |
| Msgbox "Es ist ein Fehler aufgetreten." & Chr(10) & Chr(10) _ |
| & "Fehlermeldung: " & Error$ & Chr(10) _ |
| & "Fehlernummer: " & Err & Chr(10) _ |
| & "Codezeile: " & Erl & Chr(10) _ |
| ,64,"Error" |
| Print Cstr(Error$) & " - " & Cstr(Err) & " - " & Cstr(Erl) |
| Exit Sub |
| End Sub |