ich habe einen Agenten, der aus AS400 / MAS90 die Kostenstellen nach Notes importiert:
Client Access auf dem NotesServer installiert, Verbindung eingerichtet; Agent starten, fertig !!
Sub Initialize
Dim Session As New NotesSession
Dim db As NotesDatabase
Set db = Session.currentdatabase
Dim view As NotesView
Dim Del As NotesDocument
Dim Con As New ODBCConnection
Dim Qry As New ODBCQuery
Dim res As New ODBCResultSet
' alle KST Dokumente vor einem neuen Import löschen
Dim collection As NotesDocumentCollection
Set collection = db.AllDocuments
If collection.Count <> 2 Then
Call collection.RemoveAll ( True )
End If
'Verbindungsaufbau zur AS/400
RetCode% = Con.ConnectTo("AS/400","TRANSFER","KARL")
Set Qry.Connection = Con '
Qry.SQL = "SELECT * FROM Costing.COAS01"
Set Res.Query = Qry
Res.Execute
RetCode% = Res.FirstRow
Do While RetCode% =True
ret$ = Trim(Cstr(Res.GetValue("S01001")))
If ret$ = "90" Then
Dim Doc As New NotesDocument(db)
doc.form = "KST"
doc.KSTNR = Cstr(Res.GetValue("S01006") )
doc.KSTBEZ = Cstr(Res.GetValue("S01042"))
doc.KSTVERANTW = Cstr(Res.GetValue("S01097"))
doc.KSTWERK = Cstr(Res.GetValue("S01002"))
doc.KSTGUELTIG = Cstr(Res.GetValue("S01090"))
Call doc.save (True, True)
End If
RetCode% = Res.NextRow
Loop
RetCode% = Res.Close( DB_CLOSE )
RetCode% = Con.Disconnect
End Sub
eknori