OK. Also dann:
Globals (NotesForm):
Public WFDbProfile As NotesDocument
Public SetupDbProfile As NotesDocument
QueryOpen-Event:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
Const cSetupProfileView = "DBPROFILEHIDDEN"
Dim Session As New NotesSession
Dim SetupDb As NotesDatabase
Dim SetupProfileView As NotesView
Dim cSetupServer As String
Dim cSetupFilename As String
Dim cMessage As String
' grab workflow-database profile document
Set WFDbProfile = GetDBProfileDocument Hieran nicht stören.Alles bestens
If( Source.IsNewDoc ) Then
If( Not WFDbProfile Is Nothing ) Then
cSetupServer = WFDbProfile.SetupDbServer(0)
cSetupFilename = WFDbProfile.SetupDbFilename(0)
Set SetupDb = Session.GetDatabase( cSetupServer, cSetupFilename, False )
If( Not SetupDb Is Nothing ) Then
Set SetupProfileView = SetupDb.GetView( cSetupProfileView )
Set SetupDbProfile = SetupProfileView.GetFirstDocument ' hier ist es da
If( Not SetupDbProfile Is Nothing ) Then
continue = True
Else
cMessage = |Das Profil-Dokument für die Invoice-Master Setup-Datenbank ist nicht vorhanden.
Bitte verständigen Sie den System-Administrator|
Messagebox cMessage, 64, "Datenbank-Fehler"
continue = False
End If
Else
cMessage = |Die Invoice-Master Setup-Datenbank konnte nicht erreicht werden.
Bitte kontaktieren Sie den System-Administrator|
Messagebox cMessage, 64, "Datenbank-Fehler"
continue = False
End If
Else
' don't allow to create a new user profile (let admin create a db profile first)
cMessage = |Wegen eines fehlenden Datenbank-Profil-Dokumentes können Sie
leider zur Zeit kein Benutzer-Profil anlegen.
Bitte kontaktieren Sie den System-Administrator|
Messagebox cMessage, 48, "Datenbank-Setup-Fehler"
Continue = False
End If
End If
End Sub
Und schliesslich das
PostOpen-Event:
Sub Postopen(Source As Notesuidocument)
stop
If( Not SetupDbProfile Is Nothing ) Then ' und hier nicht mehr
With Source.Document
' grab some settings from setup database's profile document
.System = SetupDbProfile .System(0)
.SystemGUID = SetupDbProfile .SystemGUID(0)
.SeratioAdress = SetupDbProfile .SeratioAdress(0)
.SeratioPort = SetupDbProfile .SeratioPort(0)
.ArchiveAdress = SetupDbProfile .ArchiveAdress(0)
.ArchivePort = SetupDbProfile .ArchivePort(0)
Call .Save(True, True)
End With
End If
End Sub
Hoffentlich hilft's