My problem is the following.
I want to create a database out of a template file. because i have to create like 20 databases i have written a little program.
But i get the message
"database databasename hasn't been openened yet"
I have tried template.Open("","Templates/" + doc.Template(0))
But this didn't solve it.
How can i make it work.
I have used the following code:
Dim template As New NotesDatabase( "", "Templates/" + doc.Template(0))
Dim brandNewDb As NotesDatabase
Set brandNewDb = template.CreateFromTemplate( Server, Map +"/" + doc.Database(0), True )
brandNewDb.Title = doc.Titel(0)
I hope it is your "/" which is causing the problem.
The path is referred by backslash "\"
Dim template As New NotesDatabase( "", "Templates\" + doc.Template(0))
Dim brandNewDb As NotesDatabase
Set brandNewDb = template.CreateFromTemplate( Server, Map +"\" + doc.Database(0), True )
brandNewDb.Title = doc.Titel(0)
Yes, as Hermantha said, the backslash is part of the problem,
However the specific error you're getting is that you have to OPEN the database before you attempt to create a document in it.
So, the code should look like this:
Dim template As New NotesDatabase( "", "Templates\" + doc.Template(0))
Dim brandNewDb As New NotesDatabase("","")
brandNewdb.open( Server, Map +"\" + doc.Database(0))
if brandNewdb.IsOpen then
brandNewDb.Title = doc.Titel(0)
else
messagebox "Database could not be opened"
end if
or, you could do it this way:
Dim brandNewDb As New NotesDatabase("","")
if (brandNewdb.Open( Server, Map +"\" + doc.Database(0))) then
brandNewDb.Title = doc.Title(0)
else
messagebox "Database could not be opened"
end if
If you still get the error, then check to make sure that the person running the code has permission to open the database.
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY. Moderators Computer101 or Netminder will return to finalize these if still open in seven days. Please post closing recommendations before that time.
Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response. This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database. If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
--> Post comments for expert of your intention to delete and why
--> You cannot delete a question with comments, special handling by a Moderator is required.
Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site. If you are an EE Pro user, use the Power Search option to find them. Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why. In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why. This helps all involved, as well as future persons who may access this item in the future to seek help.
Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made. Expert input is always appreciated to determine the fair outcome.
Thank you everyone.
Moondancer
Moderator @ Experts Exchange
0
The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
The user doesn't know that he was asking a silly question and when pointed out felt it is not worth grading this question (as it doesn't cost them anything) so this is left to the moderators discretion.
An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
The path is referred by backslash "\"
Dim template As New NotesDatabase( "", "Templates\" + doc.Template(0))
Dim brandNewDb As NotesDatabase
Set brandNewDb = template.CreateFromTemplat
brandNewDb.Title = doc.Titel(0)
~Hemanth