Domino 9 und frühere Versionen > Entwicklung

Import nach Notes

<< < (3/3)

tower:
Vielleicht hilfts ja...

http://www-10.lotus.com/ldd/sandbox.nsf/ByDateNJ/8b194f7939abc34f85256b6e004ec0be?OpenDocument

ReinhardR:
Hi Eknori,

ich habe den Agenten jetzt endlich soweit das es bei mir fast funktioniert. Mein Problem: Du löscht alle Dokumente vor dem Import. Ich müßte nur die Dokumente einer bestimmten Ansicht "AdminImport" löschen. Kannst Du mir nochmal helfen.

Reinhard

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:
Anstelle von

Dim collection As NotesDocumentCollection
  Set collection = db.AllDocuments
  If collection.Count <> 2 Then
      Call collection.RemoveAll ( True )
  End If

nimmst du :

Dim vc As NotesViewEntryCollection
Set db = session.CurrentDatabase
Set view = db.GetView("AdminImport")
Set vc = view.AllEntries
Call vc.RemoveAll(true)


eknori

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln