opendatabase
DATABASE

The opendatabase statement opens a database file.


Parameters

This statement has one parameter:

database – identifies the database you want to open. If the database is not in the same folder as the current database, you must specify the entire path name in addition to the file name.


Description

This statement opens a database. If the database is in the same folder as the current database, only the database name is needed.

opendatabase "Accounts Receivable"

If the database is in a different folder, the entire path must be specified.

opendatabase "~/Documents/Accounting/Accounts Receivable"

If the database (or one with the same name) is already open, it won’t be opened a second time. However, Panorama will bring forward a window belonging to the database (if the database has any open windows, if not, you will need to use the opensavedwindows statement).

File Extensions

All Panorama X databases have a file extension of .pandb. You can include this extension, or leave it off. Both of the lines below work exactly the same.

opendatabase "Mailing List.pandb"
opendatabase "Mailing List"

Custom Database Initialization

If the database contains a procedure named .Initialize, that procedure will run before any code following the opendatabase statement. Essentially it is as if there was a call statement after the opendatabase statement, like this:

opendatabase "Mailing List"
call .Initialize
...
... additional code
...

But don’t actually put in a call statement like this, otherwise the .Initialize procedure will be called twice! For more information, see Custom Database Initialization.

Opening a Database on Panorama X Server

If you are writing code to run on Panorama X Server (for web publishing), don’t use the opendatabase statement. Instead, you must use the openserverfile statement.

Opening a Panorama 6 Database

This statement can also be used to open a Panorama 6 database. To do that, the database filename must meet certain requirements:

When opening a Panorama 6 database with the opendatabase statement, the .pan extension must be included when specifying the file name.

opendatabase "Address Book.pan"

When opening a Panorama 6 database, Panorama X actually opens a copy of the database in Panorama X format. Any changes are made to that new copy – the original Panorama 6 database cannot be modified by Panorama X.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now also supports opening both Panorama X and Panorama 6 databases.