Delete StubLess

Delete StubLess

Messagepar Michael DELIQUE » 06 Nov 2007 à 17:19

D'après un code de Julian Robichaux


Code : Tout sélectionner
Public Function StublessDelete_API(wDoc As NotesDocument) As Integer
%REM
'variableAPI pour la fonction StublessDelete_API
Declare Function OSPathNetConstruct Lib "nnotes.dll" (Byval wnbPortName As Integer, Byval wserverName As String, Byval wfileName As String, Byval wpathName As String) As Integer
Declare Function NSFNoteDelete Lib "nnotes.dll" (Byval wnbHandleDB As Long, Byval wnbNoteID As Long, Byval wnbFlags As Integer) As Integer
Declare Function NSFDbClose Lib "nnotes.dll" (Byval wnbHandleDB As Long) As Integer
Declare Function NSFDbOpen Lib "nnotes.dll" (Byval wdbName As String, wnbRethDB As Long) As Integer
%END REM
   
   'Déclaration Variables
   Dim pathName As String*256
   Dim nbHandleDB As Long
   Dim nbResult As Integer
   Dim nbConvertID As Long
   
   Const UPDATE_NOSTUB = 0512
   Const UPDATE_FORCE = 0001   
   
   On Error Goto ErreurHandle
   
   If wDoc Is Nothing Then
      Error 9999,"wDoc is Nothing"
   End If
   
   StublessDelete_API = True
   
   'ouverture la base de document
   Call OSPathNetConstruct(0, wDoc.ParentDatabase.Server, wDoc.ParentDatabase.FilePath, pathName)
   nbResult = NSFDbOpen(pathName, nbHandleDB)
   If nbResult <> 0 Then
      Error  9999,"Database inaccessible : "+Cstr(nbResult )
      Exit Function
   End If
   
   'conversion du notesID
   nbConvertID = Clng(Val("&H" & Cstr(wDoc.NoteID))) And &H7FFFFFFF
   
   'suppression du document
   nbResult = NSFNoteDelete(nbHandleDB, nbConvertID, UPDATE_NOSTUB Or UPDATE_FORCE)
   If nbResult <> 0 Then
      Error  9999,"Suppression impossible : "+Cstr(nbResult )
      Exit Function
   End If
   
   Call NSFDbClose(nbHandleDB)
   
   Exit Function
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"

   StublessDelete_API = False   
   Exit Function
End Function
Dernière édition par Michael DELIQUE le 04 Fév 2008 à 15:58, édité 1 fois.
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Messagepar esolarc » 07 Nov 2007 à 14:08

Et c'est quoi ca le stubless ???
Avatar de l’utilisateur
esolarc
Modérateur
Modérateur
 
Message(s) : 522
Inscrit(e) le : 10 Oct 2006 à 08:23
Localisation : Genève

Messagepar Stephane Maillard » 07 Nov 2007 à 22:11

Salut,
esolarc a écrit:Et c'est quoi ca le stubless ???

Sauf erreur c'est les talons de suppressions des docs.
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

Messagepar esolarc » 08 Nov 2007 à 14:58

sous entendu la pseudo corbeille ou on peut récuperer les documents supprimés ?
Avatar de l’utilisateur
esolarc
Modérateur
Modérateur
 
Message(s) : 522
Inscrit(e) le : 10 Oct 2006 à 08:23
Localisation : Genève

Messagepar Stephane Maillard » 08 Nov 2007 à 15:24

Salut,

Tiens regarde l'article de base => http://www.nsftools.com/tips/APITips.htm#stublessdelete

Et une discution sur le forum Lotus => http://www-10.lotus.com/ldd/46dom.nsf/D ... enDocument
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