New Database Creation

Hi,

I have a DB “a.nsf” in server called “Server1”. Through coding i want to create a new DB in my local system from a.nsf including all the design, docs and ACL using Lotus script. I have tried createCopy method. It is not worked out. Any one can give me a soluntion.

Subject: New Database Creation

Dim db1 As New NotesDatabase(“serverName”,“a.nsf”)Dim db2 AS NotesDatabase

Set db2 = db1.createCopy(“”,“mycopy.nsf”)

Dim dc As NotesDocumentCollection

Set dc = db1.AllDocuments

Dim doc As NotesDOcument

Set doc = dc.getFirstDocument

Do while not Doc is Nothing

Call doc.copyToDataBase(db2)

Set doc = dc.getNextDocument(doc)

Loop

That should get you a copy of the database with the same ACL and all the documents.

Subject: RE: New Database Creation

Hi Bobby,

Thanks for ur reply. I tried the same, but all the documents from db1 is not copied to db2. If db1 has 2000 documents means only 1500 is copied into db2. I checked the documents also.Everything is fine. What could be the reason.

Subject: RE: New Database Creation

Try creating a view in the original database that captures all documents and loop the view instead of documentcollection.

Also check that you have access to all documents ie no readers fields without your name.

Subject: RE: New Database Creation

Hi Bobby,

Thanks , it is working fine. I have created a separate view.