Hallo Leute,
ich habe einen Export Agent laufen, der soweit auch funktioniert.
Der Agent läuft einmal am Tag um 22 Uhr.
Der Agent soll jetzt bei jedem Lauf eine hochzählende Datei-Endung erzeugen. Weil im Moment überschreibt er die alte Datei einfach.
Also beim ersten Lauf = "test_1.dat" dann beim zweiten Lauf = "test_2.dat" usw.
Hab schon überlegt wie ich das realisieren könnte, nur leider is mir nix eingefallen.
Habt ihr eine Idee?
Dank euch
Der jetzige Agent sieht so aus:
Sub Initialize
Const textfile$ = "/test/test.dat"
Const fldDelim% = 59 '
Dim session As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim lastCol As Integer
Dim colCnt As Integer
Dim txt As String
Dim fileNum As Integer
Dim docCnt As Integer '
Set session = New NotesSession
Set db = session.CurrentDatabase
Set view = db.GetView("test")
Call view.Refresh
view.AutoUpdate = False
lastCol = Ubound(view.Columns)
colCnt = 0
txt = ""
fileNum% = Freefile()
If Dir$(textfile, 0) <> "" Then
Kill textfile
End If
Open textfile For Output As fileNum%
Set doc = view.GetFirstDocument
docCnt = 0
While Not (doc Is Nothing)
txt = ""
For colCnt = 0 To lastCol Step 1
txt = txt + doc.ColumnValues(colCnt)
If (colCnt <> lastCol) Then
txt = txt + Chr$(59)
' Semikolon
End If
Next
Print #fileNum%, txt
docCnt = docCnt + 1
Set doc = view.GetNextDocument(doc)
Wend
Close fileNum%
End Sub