TUNING
Provide the full file name of the database (use server!!file if a remote database), or specify the keyword MAIL to open the mail database.
The following statements operate on the specified database. If the database doesn't exist, a new database is created using template [database template name]. If the keepopen option is specified (which is the string -keepopen), the database is not closed and reopened if it is already open.
Syntax
ChangeTo [database name] [database template name] [-keepopen]
Where:
Example 1
This example uses changeto to create a local database.
**Create local file using the journal template (journal.ntf)**
**NOTES.INI must contain the setting templateversion=4**
changeto journal.nsf journal[templateversion].ntf -KeepOpen
pause 5000
**Populate the view with 10 notes **
populate 10
**Open the view collection**
open
**Update the view index**
index
**Close the view collection**
close
Example 2
This example uses changeto to create multiple databases on a server. In this example the thread number is substituted in for the [#] symbol.
**Create one or more databases on a mail server using (journal.ntf)**
**NOTES.INI contains the setting templateversion=4**
**Creation of multiple databases, based on the number of threads**
**All test databases will be placed in the journal directory**
changeto [MailServer]!!journals\journal[#].nsf journal[templateversion].ntf -KeepOpen
**Populate the view with 10 documents**
Example 3
Create and initialize mail file(s)
Note: Uses Script Variable [NumMailNotesPerUser]
**Script to create and initialize mail file(s)**
changeto [MailServer]!!mail\mail[#].nsf mail60.ntf
**Make sure there are enough notes in mail database**
populate [NumMailNotesPerUser] $Inbox
**Open the current view**
**Close the current view**
drop
Parent topic: Server.Load commands
Related reference Server.Load script conventions