Hi,
mein Problem:
eine unserer Datenbanken, benutzt die Adressdaten einer anderen, damit die Adressdaten immer korrekt sind wird beim öffnen eines Dokuments die Adresse mit der AdressDB abgeglichen. Allerdings soll das nur geschehen, wenn der Eintrag in der AdressDB neuer ist. Dazu speichere ich in der ersten DB in einen unsichtbaren feld den note.LastModified Wert aus der AdressDb und vergleiche ihn mit dem aktuellen beim öffnen des Dokuments.
Obwohl beide gleich sind funktiert die if-Abfrage ums Verrecken nicht! Sowohl als String als auch als Datum.
Quelltext(verkürzt):
Sub Postopen(Source As Notesuidocument)
Set w = New NotesUIWorkspace
Set doc = source
Set note = source.Document
Dim wert As Variant
Dim s As New NotesSession
Dim v,vo As NotesView
Dim adb As NotesDatabase
Dim item1, itemxx As NotesItem
Feld_AdressDB = doc.FieldGetText("AdressDB")
Feld_ContDoc = doc.FieldGetText("ContDoc")
Feld_CompDoc = doc.FieldGetText("CompDoc")
Feld_ContMod = doc.FieldGetText("ContMod")
Feld_CompMod = doc.FieldGetText("CompMod")
Set adb=s.GetDatabase( "", Feld_AdressDB )
If note.ContDoc(0) <> "" Then
If adb.title <> "" Then
Set adoc = adb.GetDocumentByUNID(Feld_CompDoc)
wert = adoc.Lastmodified
If Cdat(wert) <> Cdat(Feld_CompMod) Then
... Felder neu setzten
EndIf
Set adoc = adb.GetDocumentByUNID(Feld_ContDoc)
wert1 = adoc.Lastmodified
If wert1 <> Feld_ContMod Then
... Felder neu setzten
End If
End If
End Sub
Wenn ich mir die werte mit z.B. MessageBox() anzeigen lasse bekomme ich wert="16.06.03 15:09" und für Feld_CompMod="16.06.03 15:09".
Trotzdem sind die werte nicht gleich - WARUM?