ViewDeleteAll

ViewDeleteAll

Messagepar Stephane Maillard » 01 Août 2005 à 12:38

[syntax="ls"]Const wAPIModule = "NNOTES" ' Windows/32



Const NOTE_CLASS_VIEW = 8

Const DFLAGPAT = "-FG40n" ' views



Declare Function IDCreateTable Lib wAPIModule Alias "IDCreateTable" _

( Byval A As Long, hT As Long) As Integer

Declare Function IDDestroyTable Lib wAPIModule Alias "IDDestroyTable" _

( Byval hT As Long) As Integer

Declare Function IDEntries Lib wAPIModule Alias "IDEntries" _

( Byval hT As Long) As Long



Declare Function NIFFindDesignNoteExt Lib wAPIModule Alias "NIFFindDesignNoteExt" _

( Byval hDB As Long, Byval T As String, Byval C As Integer _

, Byval P As String, N As Long, Byval F As Long) As Integer

Declare Private Function NIFCloseCollection Lib wAPIModule Alias "NIFCloseCollection" _

( Byval hCL As Long) As Integer

Declare Private Function NIFOpenCollection Lib wAPIModule Alias "NIFOpenCollection" _

( Byval hVDB As Long, Byval hDDB As Long, Byval N As Long, Byval F As Integer, Byval U As Long _

, hCL As Long, Byval hNT As Long, Byval hVU As Long, Byval hC As Long, Byval hS As Long) As Integer

Declare Private Function NIFGetIDTable Lib wAPIModule Alias "NIFGetIDTable" _

( Byval hC As Long, Byval F As Long, Byval hT As Long) As Integer



Declare Function NSFDbOpen Lib wAPIModule Alias "NSFDbOpen" _

( Byval P As String, hDB As Long) As Integer

Declare Function NSFDbClose Lib wAPIModule Alias "NSFDbClose" _

( Byval hDB As Long) As Integer

Declare Function NSFDbDeleteNotes Lib wAPIModule Alias "NSFDbDeleteNotes" _

( Byval hDB As Long, Byval hT As Long, Byval zU As Long) As Integer



Declare Function OSPathNetConstruct Lib wAPIModule Alias "OSPathNetConstruct" _

( Byval P As Long, Byval S As String, Byval F As String, Byval N As String) As Integer





Sub ViewDeleteAll(db As NotesDatabase, viewname As String)

Dim hDB As Long

pn$ = Space(1024)

OSPathNetConstruct 0, db.Server, db.FilePath, pn$

NSFDbOpen pn$, hDB



NIFFindDesignNoteExt hDB, viewname$, NOTE_CLASS_VIEW, DFLAGPAT, id&, 0

If id& = 0 Then Error 1000, "Can't find view " & viewname$



Dim hC As Long, hT As Long

NIFOpenCollection hDB, hDB, id&, 0, 0, hC, 0, 0, 0, 0

IDCreateTable 0, hT

NIFGetIDTable hC, 1, hT

NSFDbDeleteNotes hDB, hT, 0

IDDestroyTable hT

NIFCloseCollection hC

NSFDbClose hDB

End Sub[/syntax]
Cordialement

Stéphane Maillard
Avatar de l’utilisateur
Stephane Maillard
Lord of DominoArea
Lord of DominoArea
 
Message(s) : 8695
Inscrit(e) le : 16 Déc 2004 à 01:10
Localisation : Bretagne

Retour vers API

cron