Page 1 sur 1

Encore un plantage que j'explique pas...

MessagePublié: 09 Déc 2009 à 14:15
par Ahamay
Hello @ll

Ca doit pas être grand chose mais c'est bizare. J'appelle différentes fonctions avec les mêmes paramètres... et pour une ça plante qund j'instancie une db !!
-> en rouge les lignes qui me soucient... la première est celle qui renvoie l'erreur, la seconde c'est qu'il ne se passe rien... pas d'ajout dans le champ ArchiveLog !!!

L'appel :

Dim sourceServer As String
Dim sourcePath As String
sourceServer = curdoc.server(0)
sourcePath = curdoc.PathName(0)

tmpLocalPath =Replace( "C:\TmpReplica\" & sourcePath, "/","\")
Set RattacheDb = dbToArchive.CreateCopy ( "",tmpLocalPath )


If curdoc.DatabaseType(0) <> "1" Then
Call curdoc.ReplaceItemValue("LogArchive", "## Rattachement ## "+ Chr$(13) + curdoc.GetItemValue("LogArchive")(0))
Call CopyKeyWord (curdoc, sourceServer, sourcePath, "", tmplocalPath )
Call CopyACL(sourceServer, sourcePath, "", tmplocalPath)
Call CopyProfile(curdoc, sourceServer, sourcePath, "", tmplocalPath )
End If



Et la proc qui déconne :


Sub CopyProfile(curdoc As notesdocument, PrdServer As String, PrdPath As String, NewDbServer As String, NewDbPath As String)

On Error 0 Resume Next
On Error 20 Resume Next
On Error Goto ErrLog

Dim dbProd As NotesDatabase
Dim dbTest As NotesDatabase
Dim prodDocProfile As NotesDocument

Set dbProd = New NotesDatabase(prdServer, prdPath)
......
ErrLog :

Msgbox "err : " & Error
Call curdoc.ReplaceItemValue("ArchiveLog", " Attach : Copie doc Profile, Err :" + Str(Err) +Chr$(13) +curdoc.GetItemValue("ArchiveLog")(0))
Call curdoc.save(True, False)

Exit Sub
End Sub

:mur:
Pourtant les param que je passe sont ok, la meilleure preuve c'est qu'ils apparaissent dans le message d'erreur. La base existe et j'ai les droits pour l'ouvrir ! alors quid ?
:mur:

MessagePublié: 09 Déc 2009 à 14:19
par Michael DELIQUE
test ta dbprod avec cette fonction => http://forum.dominoarea.org/detecter-la ... 10711.html

pour savoir si elle est correctement instancié

MessagePublié: 09 Déc 2009 à 14:32
par Ahamay
wDB Is Nothing ,
voila ce que me renvoi DBExists_LS..... mais pourquoi ?

Comment un New Database peut il renvoyer nothing ? alors qu'on lui passe 2 arguments corrects ???

Je viens de tester avec :

Set dbProd = New NotesDatabase(curdoc.server(0), curdoc.pathName(0))

bin tu sais quoi, ça marche !

C'est quand même bizarre non ?

MessagePublié: 09 Déc 2009 à 14:55
par Michael DELIQUE
c'est pour ça que j'ai fais cette fonction => http://forum.dominoarea.org/connexion-a ... 10712.html