While db.CreateCopy in R6, does not copy the image resources

I have created a script to create db's but it does not copy the image Shared Ressources. Do you know how I can get these resources and copy them to the new db with script?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What do you do in the script.. copy design element by element ??

Don't you use CreateCopy method of the database ?

koray_uygunAuthor Commented:
Set templateDB = New notesDatabase ( doc.txtTempDBServer(0) , doc.txtTempDBPath(0))
Print "Creating New DB : " + doc.txtDBName(0)
Set targetDB =  templateDB.CreateCopy( dbServer , dbPath)
dbName = doc.txtDBName(0)
Createcopy is known to fail in some cases, I use this :

Const NOTE_CLASS_ALL = 32767%

Declare Function OSPathNetConstruct Lib "NNotes.dll" Alias "OSPathNetConstruct" (Byval PortName As String, Byval ServerName As String, Byval FileName As String, Byval retPathName As String) As Integer
Declare Function OSLoadString Lib "NNotes.dll" Alias "OSLoadString" (Byval hModule As Long, Byval StringCode As Long, Byval retBuffer As String, Byval BufferLength As Integer) As Integer
Declare Function NSFDbClose Lib "NNotes.dll" Alias "NSFDbClose" (Byval hDB As Long) As Integer
Declare Function NSFDbCreateAndCopy Lib "NNotes.dll" Alias "NSFDbCreateAndCopy" (Byval srcDb As String, Byval dstDb As String, _
Byval NoteClass As Integer, Byval limit As Integer, Byval flags As Long, retHandle As Long) As Integer

Function CreateDBCopy(fromServer As String, fromDBPath As String, toServer As String, toDBPath As String, _
noteFlags As Integer, mbSize As Integer, copyFlags As Long) As NotesDatabase

Dim fromNetPath As String
Dim toNetPath As String
Dim hDb As Long
Dim ret As Integer

Set CreateDBCopy = Nothing

fromNetPath = String(256,Chr(0))
toNetPath = String(256,Chr(0))

If OSPathNetConstruct("",fromServer, fromDBPath, fromNetPath) <> 0 Then
Error 32000, "Could not create Network Path from " + fromServer + " & " + fromDBPath
End If

If OSPathNetConstruct("",toServer, toDBPath, toNetPath) <> 0 Then
Error 32000, "Could not create Network Path to " + toServer + " & " + toDBPath
End If

ret = NSFDbCreateAndCopy(fromNetPath, toNetPath, _
noteFlags, mbSize, copyFlags, hDb)

If ret = 0 Then

Call NSFDbClose(hDb)
Set CreateDBCopy = New NotesDatabase(toServer, toDBPath)

Error 32000, "Error creating database" + toDBPath + " on " + toServer + ": " + OSErrorString(ret)
End If

End Function

' In your routine...
' The routine will return the database if created, and will raise an error if there is a problem.
' If there are any private design elements, it still fails, so you need to trap for that situation.

Set toDB = CreateDBCopy(fromDB.Server, fromDB.FilePath, baseServer.Canonical, basePath + "\" + repidToFile(Listtag(dbv)), NOTE_CLASS_ALL - NOTE_CLASS_PRIVATE, 0, 0)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I like to create replica and change the replica ID.
koray_uygunAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.