• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Write a program to create databases

How would i go about writing a small notes app to automate the createion of databases?

i need to create databases of the "ms office library" template on the server MAIL_PR with the filename xxxx.nsf (eg 1234.nsf) and the description "xxxx - description" in one of any subdorectory (currently there are bout 6) in the domino\data\databases direcotry.

quite easy really from a codeing point of view, but i havn't a clue where to start with notes designer - any pointers would be greatly appreciated.


3 Solutions
Sjef BosmanGroupware ConsultantCommented:
For your purpose, it might be best to create an agent. The call you should look into is the CreateFromTemplate method.
Open your designer and write this script either in a agent or action button

Dim template As New NotesDatabase( "SERVERNAME", "doclbm50.ntf" )
Dim nDb As NotesDatabase
Set nDb = template.CreateFromTemplate( "SERVERNAME", "FILE_PATH_NAME", True )

ZvonkoSystems architectCommented:
May I ask what would be the advantage of some program creating databases instead of doing it manualy?
I mean, you cannot allow the user to run an Agent to create a database on server if he is not also already allowed to create the database manualy.
Scanning the server subdirectories and placing one database in every subdirectory does not make to much sense to me.
If you have more then twenty subdirectories in on AppDir below notesdata, then perhaps it would make sense.
But keep in mind that you have to hardcode many parts and test them before allowing users to do a night fly.
In the same time you could create the databases by hand.

For more details look at this example:

pelsonroseAuthor Commented:
For every customer we get we create an office type database, and then make a mailin rule so ppl can file relavent data there. I have to set up these databases and am sick of creating batches of 20 datbases in the same place in one go. I want to automate the process so all i have to do create a txt file (or a csv) and have the machine do all the work, while i take the morning off ;-)
Sjef BosmanGroupware ConsultantCommented:
Then create those databases once, leave them empty, and whenever a new customer arrives, copy these new databases to the customer's area in Notes. Then adapt the ACL of one database and copy it to the others using the Administrator client. DOn't do the copy outside Notes (using the O/S copy functionality) because that would create replica databases. The overall functionality is about the same, it might be easier to implement, using only NotesDatabase.CreateCopy calls.

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now