[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2004-10-22
5
Medium Priority
?
285 Views
Last Modified: 2013-12-18
Hi,
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?

Thanks,
Koray.
0
Comment
Question by:koray_uygun
5 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12380702
What do you do in the script.. copy design element by element ??

Don't you use CreateCopy method of the database ?

~Hemanth
0
 

Author Comment

by:koray_uygun
ID: 12380893
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)
0
 
LVL 14

Accepted Solution

by:
p_partha earned 500 total points
ID: 12381488
Createcopy is known to fail in some cases, I use this :

Const NOTE_CLASS_PRIVATE = 4096%
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)

Else
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)


Partha
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12383645
I like to create replica and change the replica ID.
0
 

Author Comment

by:koray_uygun
ID: 12398387
Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question