setdatabaseoptions
DATABASE
,
OPTION
,
VALUE
The setdatabaseoptions statement modifies one or more properties of a database.
Parameters
This statement has three parameters:
database – The database that contains the properties you want to modify, or ""
for the current database.
option – The type of information you want to modify. See below for descriptions of each option. The option can be specified in either upper or lower case.
value – The new value for this option.
Description
This statement modifies the properties associated with a database. The database must be open.
Note: You can specify multiple option/value pairs in a single setdatabaseoptions statement, like this:
setdatabaseoptions dataabase,,option1,value1,option2,value2,option3,value3
AutoNumber
This option modifies changes the automatically generated number for the next record that will be added to the database. This allows you to generate numbers out of sequence, or to start the sequence at a specific value. This example sets the number to 1001.
setdatabaseoptions "","AutoNumber",1001
Note: You can find out the current autonumber value with the dbinfo( function. This example skips the next 50 numbers:
setdatabaseoptions "","Autonumber",dbinfo("autonumber","")+50
AngleUnits
Panorama normally performs trigonometry calculations using radians, but you can override this on a database-by-database basis.
setdatabaseoptions "","AngleUnits","degrees"
Once set, any trig calculations performed while this database is active will be performed using the specified angular units (unless overridden with the Degree or Radian statements.
If set to true, this database will not be included in the File>Recent menu.
setdatabaseoptions "","ExcludeFromRecentMenu",true()
For example, you might want to do this for an auxilliary database that is secretly opened for lookups but not opened directly.
Data Sheet Dimentions
There are four options that allow you to specify the dimensions that will be used the next time the data sheet is opened. The dimensions are specified in points (72 points = 1 inch).
setdatabaseoptions "",
"DataSheetTopEdge",80,
"DataSheetLeftEddge",50,
"DataSheetHeight",450,
"DataSheetWidth",600
Note: If the data sheet is currently open, changing these values won’t have any effect, since Panorama will retain the values of the actual visible data sheet.
This option allows you to specify whether the tool bar will appear the next time the data sheet is opened. Use "notoolbar"
or "nopalette"
if you don’t want the toolbar to appear. If you do want it to appear, use ""
.
setdatabaseoptions "","DataSheetWindowOptions","notoolbar"
Note: If the data sheet is currently open, changing this option won’t have any effect, since Panorama will retain the toolbar status of the actual visible data sheet.
Security Settings
The setdatabaseoptions statement can enable and disable the same security settings available in the Database Options dialog – locking to an account, encryption, and authorized roles (in fact the Database Options dialog uses the setdatabaseoptions statement). Of course these options are only available if you are an authorized user, otherwise you’ll get an error. Be careful – if you are not logged on as an administrator it’s possible to get the database into a state that you are not authorized to get it out of!
To lock the database to the current account, use the "locktoaccount"
option.
setdatabaseoptions "","locktoaccount",true()
Note: all of the options below require that the database be locked to the account.
To encrypt the database (AES–256 encryption), use the encrypt options:
setdatabaseoptions "","locktoaccount",true(),
"encryptdata",true(),
"encryptforms",true(),
"encryptprocedures",true(),
Roles
There are four possible roles that a database user can have (see Managing Account Roles): Administrator, Developer, User and Anyone. Use the "OpenRole"
option to specify which role is required to open the database:
setdatabaseoptions "","OpenRole","Administrator"
Again, be careful! If you are not logged on as administrator, the statement above will make the database innacessible to you!
To specify what role is required to change the design of the database, use the "DesignRole"
option.
setdatabaseoptions "","DesignRole","Developer"
Once this is set, only developers and administrators will be able to change the design of this database, which includes adding or removing fields, editing procedures, or, in fact, running the setdatabaseoptions statement.
You can also use the "StandardUIRole"
to specify what roles are allowed to use Panorama’s standard menus and tools.
setdatabaseoptions "","StandardUIRole","Developer"
With this setting, only Developers and Administrators will be able to use the tool palette and standard menus. Regular users will only be able to use pre-programmed procedures that have been set up by a developer or admin user.
See Also
- Importing a Panorama 6 Database -- Importing a Panorama 6 Database
- addfield -- adds a new field to the current database (on the end).
- addlines -- adds a specified number of records to the end of a database.
- addrecord -- adds a new record at the end of the current database.
- arraybuild -- builds an array by scanning a database and creating an array element for every record (including invisible records) in the database (see Text Arrays).
- arraybuild( -- builds an array by scanning a database and creating an array element for every record (including invisible records) in the database (see Text Arrays).
- arrayselectedbuild -- builds an array by scanning a database and creating an array element for every visible (selected) record in the database (see Text Arrays).
- arrayselectedbuild( -- builds an array by scanning a database and creating an array element for every visible (selected) record in the database (see Text Arrays).
- autoallfieldwidths -- automatically sets the width of all fields based on the data in each field.
- autofieldwidth -- automatically sets the width of the current field based on the data in it.
- automaticfieldchoices -- updates the current field's Choice list with actual data in the database.
- cell -- enters a value into the currently active field (i.e. cell).
- clearcell -- deletes the contents of the current field.
- clearrecord -- deletes the currently selected record.
- closedatabase -- closes a specified database.
- closefile -- closes the current database.
- commonfieldspopup -- pops up a list of common fields, and changes the current field specifications when a field is chosen from this menu.
- constructfields -- creates one or more new fields based on a template.
- copycell -- copies the contents of the current field onto the clipboard,
replacing anything previously on the clipboard.
- copyrecord -- copies the contents of the current record onto the clipboard.
- Creating a New Database -- creating a new database.
- cutcell -- delete the contents of the current cell and places the deleted data on the clipboard.
- cutline -- copies the current record to the clipboard and deletes it.
- cutrecord -- copies the current record to the clipboard and deletes it.
- databaseexportcsv -- exports selected records in the current database in CSV format (comma separated) to a text file.
- databaseexportjson -- exports selected records in the current database in JSON format to a text file.
- databaseexporttsv -- exports selected records in the current database in TSV format (tab separated) to a text file.
- databaseexportusingformula -- exports selected records in the current database to a text file, using a formula.
- datatype( -- determines what kind of data is in a field or variable: text, number, etc.
- datavalue( -- returns the value of a field or variable: text, number, etc.
- dbcheckopen( -- returns true if the specified database is currently open, false if it is not.
- dbinfo( -- gets information about a database: what forms it contains, what fields, what flash art pictures, etc.
- deleteabove -- copies the current record to the clipboard and deletes it, then moves to the record above.
- deletefield -- deletes the current field from the database.
- deleterecord -- deletes the currently selected record.
- downrecord -- moves the cursor down one visible record.
- duplicaterecord -- duplicates the current record.
- editcell -- opens the edit window for the currently active field (or cell), highlighting the data, and allows you to edit that field.
- editcellstop -- opens the edit window for the currently active field (or cell), highlighting the data, and allows you to edit that field.
- emptydatabase( -- returns true if the current database is completely blank.
- emptyfield -- tells Panorama to move to the next available (empty) field in a series of line item fields.
- emptyline( -- returns true if the entire current record (all fields) is blank, otherwise it is false.
- excludefromrecentmenu -- excludes the next opened database from the Recent menu.
- export -- exports the selected rows in the current database into a text file.
- exportjson -- exports the current database in JSON format.
- fieldname -- changes the name of the current field.
- fieldtype -- changes the data type of the current field.
- fieldvalue( -- grabs the contents of a field in the current record of a database. You can grab data from the current database, or from another database.
- firstrecord -- makes the first visible (selected) record in the database the active record.
- formulacalc -- allows you to evaluate a formula that you were not able to
code into the procedure when it was being written.
- formulavalue -- calculates the result of a formula. Usually this is done with an assignment statement (for example `x=2 * y` ), but the *formulavalue* statement gives you more flexibility. You can specify what database is to be used for the calculation (an assignment statement always uses the current database) and you can specify the formula using a variable, making it easy to change on the fly. This statement also gives you more control over how errors are handled.
- formulavalue( -- calculates the result of a formula based on data in the current record of any open database. This is similar to the fieldvalue( function, but allows any formula to be used, rather than just a single field.
- getautonumber -- gets returns the automatically generated number for the next record that will be added to the database.
- getautonumber( -- returns the automatically generated number for the next record that will be added to the database.
- getfieldproperties( -- returns a dictionary containing all of the properties of the specified field. (See the setfieldproperties statement if you want to change one or more field properties.)
- getproceduretext -- gets the contents (source) of a procedure and places it in a variable.
- growl -- displays a notification.
- growlmessage -- displays a notification.
- importdatabase -- imports data from another database into the current database.
- Importing Binary Data from Panorama 6 -- Importing Binary Data from Panorama 6
- importjson -- imports a JSON array into the current database.
- importjsonline -- imports a JSON record into the current record.
- importline -- imports a line of text into the current record.
- importtext -- imports text into an existing database.
- info("databasefilename") -- returns the name of the current database.
- insertbelow -- inserts a new record below the current record.
- insertbelowcarriagereturn -- inserts a new record below the current record and moves to the first column.
- insertfield -- inserts a new field into the database in front of the current field.
- insertrecord -- inserts a new record above the current record.
- lastlookupdatabase( -- returns the name of the database referenced in the most recent lookup.
- lastrecord -- makes the last visible (selected) record in the database the active record.
- left -- makes the previous field active in the active window.
- listchoices( -- builds a text array containing a list of all the values stored in a specified field.
- lookup( -- searches a database for a value, then returns other information from the same record. For example, the *lookup(* function can look up a phone number given a customer name, or look up a price given a part number.
- lookupall( -- builds a text array containing one item for every record in the target database where the data in the keyField matches the keyData. Each item in the text array contains the value extracted from the dataField for that record. If the data field is a numeric or date field, it is converted to text using the default patterns for that field.
- lookupalldouble( -- is similar to the lookupall( function, but it returns two fields from the target database instead of just one.
- lookupalloctet( -- is similar to the lookupall( function, but it returns eight fields from the target database instead of just one.
- lookupallquadruple( -- is similar to the *lookupall(* function, but it returns four fields from the target database instead of just one.
- lookupallquintuplet( -- is similar to the *lookupall(* function, but it returns five fields from the target database instead of just one.
- lookupallseptuplet( -- is similar to the lookupall( function, but it returns seven fields from the target database instead of just one.
- lookupallsextet( -- is similar to the lookupall( function, but it returns six fields from the target database instead of just one.
- lookupalltriple( -- is similar to the lookupall( function, but it returns three fields from the target database instead of just one.
- lookuplast( -- searches the selected records in a database for a value, then returns other information from the same record. For example, the * lookuplast(* function can look up a phone number given a customer name, or look up a price given a part number. Unlike the lookup( function which searches from the top of the database, the *lookuplast(* function searches backwards from the bottom.
- lookuplastselected( -- searches the selected records in a database for a value, then returns other information from the same record. For example, the *lookuplastselected(* function can look up a phone number given a customer name, or look up a price given a part number. Unlike the lookupselected( function which searches from the top of the database, the *lookuplastselected(* function searches backwards from the bottom.
- lookupmoredata( -- looks up an additional data field based on the previous lookup.
- lookupmoreformula( -- looks up additional data based on a previous lookup.
- lookupselected( -- searches the selected records in a database for a value, then returns other information from the same record. For example, the *lookupselected(* function can look up a phone number given a customer name, or look up a price given a part number.
- movefieldbefore -- moves the current field to a new position.
- moverecorddown -- moves the current record down one line.
- moverecordup -- moves the current record up one line.
- newdatabase -- creates a new database.
- newdatabasewithfields -- creates a new database with one or more fields.
- newdatabasewithjson -- creates a new database using a JSON file.
- newdatabasewithtemplate -- creates a new database with a template.
- newdatabasewithtextfieldnames -- creates a new database from a text file. The text file must contain the field names in the first line.
- opendatabase -- opens a database file.
- openfile -- opens a database file. It can also import data from a text file, another database, or a variable into the current database.
- openplain -- opens a database without opening any pre-saved windows, just the data sheet.
- opensecret -- opens a database invisibly, without opening its windows.
- opentextfile -- imports data from a text file or a variable into the current database.
- pastecell -- pastes the contents of the clipboard into the current cell.
- pasteline -- inserts a new record containing the contents of the clipboard.
- pasterecord -- inserts a new record containing the contents of the clipboard.
- printpdf -- prints the current database to a PDF file.
- printpreview -- previews what printing the current window will look like.
- printpreviewonerecord -- previews what printing the current record will look like.
- recalculatefield -- recalculates all values in current field based on field's formula (selected records only).
- recompile -- recompiles all procedures in a database.
- right -- moves the cursor to the next field in the active window.
- runfieldcalculations -- performs any automatic calculations associated with the current field.
- runfieldcode -- runs the automatic code associated with the specified field.
- runfieldsideeffects -- performs any side effects associated with the current field (calculations, procedures, etc.).
- saveblueprint -- save a blueprint of a database's structure.
- setactivedatabase -- makes a database active (without changing the configuration of the windows).
- setautonumber -- changes the automatically generated number for the next record that will be added to database. This allows you to generate numbers out of sequence, or to start the sequence at a specific value.
- setfieldnames -- changes the names of all database fields at once.
- setfieldproperties -- modifies one or more properties (name, data type, formula, etc.) of the current field.
- sizeof( -- calculates the amount of memory used by a field or a variable.
- superarraybuild -- scans a database to create a text array. This statement is is similar to arraybuild, but with a number of additional options (see Text Arrays).
- superlookup( -- searches a database for a record that matches a query formula, then uses a second formula to return other information from the same record. This is similar to the lookup( function, but instead of using an individual field for the key and data, any valid true/false (Boolean) formula can be used.
- table( -- searches a database for a value, then returns other information from the same record. Unlike the lookup( function, the *table(* function does not require an exact match. If it does not find an exact match the *table(* function will use the closest match. For example, the *table(* function can look up a tax rate given an income amount, or look up a shipping price given a zip code and weight.
- uniqueid( -- generates ID codes with a text root and a numeric suffix (for example `Jeff261`).
- unlockrecord -- unlocks the currently active record.
- uprecord -- moves the cursor up one visible record.
History
10.0 | New | This statement is new in this version. |