Page 1 sur 1
Extraction

Publié:
12 Oct 2011 à 13:56
par BLONDIN
avec leurs noms, prenoms, fichier courrier, taille de la bal, derniere modif sur la bal (envoi-reception de mails),
Merci bien !

Publié:
12 Oct 2011 à 14:00
par BLONDIN
J'ai besoin du script que je mettrai ds mon CA afin de l'executer depuis Designer.

Publié:
12 Oct 2011 à 14:03
par Michael DELIQUE
va falloir le coder !

Publié:
12 Oct 2011 à 14:08
par Michael DELIQUE
un début =>
http://forum.dominoarea.org/pister-la-t ... 10379.html
sinon parcours les tips tu trouvera des fonction qui devraient t'aider

Publié:
12 Oct 2011 à 14:16
par BLONDIN
Je ne connais pas, peux-tu stp m'aider car j'ai un script et je pense qu'il n'est pas bon.
Voila le script avec en encadrer la description du getlast date qui me fait galerer je pense
REM
Function getLastDate
Description: Comments for Function
%END REM
Function getLastDate(mailDB As NotesDatabase) As String
Dim mailDocuments As NotesDocumentCollection
Dim mailDoc As NotesDocument
Dim dateMax As variant
Set mailDocuments = mailDB.Alldocuments
Set mailDoc = mailDocuments.Getfirstdocument
dateMax = mailDoc.Lastmodified
While Not (mailDoc Is NOTHING)
If mailDoc.Lastmodified > dateMax Then
dateMax = mailDoc.Lastmodified
End If
Set mailDoc = mailDocuments.Getnextdocument(mailDoc)
Wend
getLastDate = dateMax
Exit function
End Function
Option Public
Option Declare
Sub Initialize
On Error Goto boom
On Error Resume Next
Dim fileNum As Integer
fileNum% = Freefile()
Open "c:\extract4_"+Format(Cstr(Now),"medium date")+".csv" For Output As fileNum%
Print #fileNum%, "nom"+";"+"prenom"+";"+"mail"+";"+"chemin base"+";"+"taille base MO"+";"+"region"+";"+"groupes"+";"+"derniere modif"+";"+"Archive"+";"+"taille archive"
Dim s As New NotesSession
Dim db As notesdatabase
Dim v As NotesView
Dim serverAccess As NotesView
Dim nve As NotesViewEntryCollection
Dim groups As NotesDocumentCollection
Dim ve As NotesViewEntry
Dim group As NotesDocument
Dim uname As String
Dim groupList As String
Dim userMailDB As NotesDatabase
Dim userArchive As NotesDatabase
Set db = s.currentdatabase
Set v = db.GetView("People")
Set serverAccess = db.GetView("UsersGroups")
Set nve = v.AllEntries
Set ve = nve.GetFirstEntry
Dim prenom As String
Dim nom As String
Dim nomTmp As variant
Dim mail As String
Dim basePath As String
Dim region As String
Dim mailSize As String
Dim lastMod As String
Dim cheminarchive As String
Dim archiveSize As String
Dim docarchive As NotesDocument
While Not ve Is Nothing
'Print
uname = ve.ColumnValues(2)
prenom = ve.ColumnValues(3)
nom = ve.ColumnValues(4)
mail = ve.ColumnValues(5)
basePath = ve.ColumnValues(6)
region = ve.ColumnValues(7)
' If (nom Like "*formation*") Then
'Print uname+" "+Cstr(db.QueryAccessRoles(uname))
Set groups = serverAccess.GetAllDocumentsByKey(uname,True)
groupList = ""
If groups.Count > 0 Then
Set group = groups.GetFirstDocument
While Not group Is Nothing
If groupList = "" Then
groupList = group.ListName(0)
Else
groupList = groupList +","+ group.ListName(0)
End If
Set group = groups.GetNextDocument(group)
Wend
End If
Set userMailDB = s.GetDatabase(db.Server,basePath,False)
mailSize = ""
lastMod = ""
cheminarchive=""
archiveSize=""
If Not userMailDB Is Nothing Then
mailSize= CStr(userMailDB.Size/1024/1024)
lastMod = CStr(userMailDB.LastModified)
'- - - - -
Set docarchive = userMailDB.GetProfileDocument("archive profile")
If Strright(docarchive.ArchLastRunDestDBs(0),"!!") <>"" Then
If docarchive.ArchLastRunDestDBs(0)<>"" Then
If StrRight(docarchive.ArchLastRunDestDBs(0),"!!")="" Then
cheminarchive=docarchive.ArchLastRunDestDBs(0)
Else
cheminarchive=StrRight(docarchive.ArchLastRunDestDBs(0),"!!")
End If
cheminarchive=Strright(docarchive.ArchLastRunDestDBs(0),"!!")
Set userArchive=s.GetDatabase("LN04SIE/FRANCE",cheminarchive)
If Not userArchive.IsOpen Then
archiveSize="Pb ouverture"
Else
If Not userArchive Is Nothing Then
archiveSize=CStr(userArchive.Size/1024/1024)
End If
End If
'- - - - -
End If
'Print uname + groupList
Print #fileNum%, nom+";"+prenom+";"+mail+";"+basePath+";"+mailSize+";"+region+";"+groupList+";"+lastMod+";"+cheminarchive+";"+archiveSize
Set ve = nve.GetNextEntry(ve)
' End If
Wend
Close fileNum%
Print "extraction finie"
Exit Sub
%REM
boom:
Msgbox Error+" ("+Cstr(Erl)+")"
Print Error+" ("+Cstr(Erl)+")"
Close fileNum%
Exit Sub
%END REM
End Sub
%REM
Function getLastDate
Description: Comments for Function
%END REM
Function getLastDate(mailDB As NotesDatabase) As String
Dim mailDocuments As NotesDocumentCollection
Dim mailDoc As NotesDocument
Dim dateMax As variant
Set mailDocuments = mailDB.Alldocuments
Set mailDoc = mailDocuments.Getfirstdocument
dateMax = mailDoc.Lastmodified
While Not (mailDoc Is NOTHING)
If mailDoc.Lastmodified > dateMax Then
dateMax = mailDoc.Lastmodified
End If
Set mailDoc = mailDocuments.Getnextdocument(mailDoc)
Wend
getLastDate = dateMax
Exit function
End Function

Publié:
12 Oct 2011 à 14:18
par Michael DELIQUE
re,
déjà insert les balise [ code ] [ /Code ] ensuite insert une gestion des erreurs dans otn code. et la franchement faut le faire en débug

Publié:
12 Oct 2011 à 14:25
par BLONDIN
Je suis désolé, je ne comprends pas. Admin NOTES mais pas pour le coté script et language. Peux-tu m'aider stp, dis moi de quoi tu as besoin ?

Publié:
12 Oct 2011 à 14:43
par Michael DELIQUE
désolé, je peux pas faire le boulot a place

Publié:
12 Oct 2011 à 14:51
par BLONDIN
je ne te demande pas de faire mon boulot, ne pas comprendre des termes alors que je suis ds un forum d'entre aide, je pense qu'une expliquation peut etre possible. Ne t'inquiete pas; je ne suis pas du genre à attendre qu'on me serve sur un plateau. Mnt, mon script est mauvais, peux-tu m'indiquer à quel endroit, il ya des erreurs stp ?

Publié:
12 Oct 2011 à 15:14
par Michael DELIQUE
désolé,
comme ça je ne peut pas, le plus simple est de le faire tourner en mode debug et en suivant chaque ligne d'instruction jusqu'a ce que ça plante ou que ça ne fasse pas ce que ça doit.
mais comme j'ai doute sur le teste de date généralement on fait selon 2 manière
- via un objet notesdatetime et un notesDateTime.TimeDifference (cf aide en ligne)
- soit tu converti ta date au format numérique via un ccur(format(madate,"YYYYMMDDHHNNSS")) et la le > fonctionne

Publié:
12 Oct 2011 à 15:21
par BLONDIN
Merci Michael !