| Command group | Flag affected | Reversible | Execute on client | Platform(s) |
| Data files | YES | NO | NO | All |
| Do not close other data | If specified,the command does not close all open data files before opening the specified data file |
| Read-only | If specified,the data file is opened in read-only mode |
| No conversion by runtime | Omnis normally offers to convert data files created by an earlier version of Omnis. If this option is specified,the runtime version of Omnis will not offer to convert the file,and the command will fail |
| Convert without user prompts | If specified,and conversion is allowed, Omnis will immediately perform the conversion without giving the user any prompts that require a response; also, the user cannot cancel the conversion |
| Full Unicode conversion | Unicode Studio only.If specified,and convert without user prompts is specified,do full Unicode conversion instead of quick conversion (quick conversion is only ok when you know all character data in the file is 7 bit) |
This command opens the specified data file and makes that file the "current" data file. It clears the flag if the data file cannot be found or opened. If the Do not close other data check box option is not specified, all existing data files are closed even if the command fails. Opening a data file which is already open will close and reopen that data file. The Read-only check box causes the data file to be opened in read-only mode.
If you select the No conversion by runtime option, and the data file was created with a previous version of Omnis, then the runtime version of Omnis will not convert the data file. The default is that an Omnis runtime will ask the user if they want to convert the data file.
If an opened data file uses more than one segment, all segments are opened. The rules for finding the additional segments which form part of the data file are as follows:
You can override the default internal name by specifying your own in the parameter for the command.
If the data file is to be accessed using the ODB (Omnis Data Bridge), then instead of using a pathname, you specify the location of the file using a special syntax:
where address:port is the TCP/IP address and port number of the ODB server, e.g. 127.0.0.1:5900, and name is the name of a data file accessed using the ODB server. You can omit address:port:, in which case Omnis uses the address and port stored in the $odbserver root preference. Note that the value of $odbserver is stored in the file odb.txt in the studio folder of the Omnis installation tree.
Open data fileSales.df1,Sales
If flag trueFind firstIf flag trueOpen data file(Do not close other data)Purch.df1,PurchasesIf flag trueCalculatefPurchases.Field1asfSales.Field1Prepare for insert with current valuesEnter dataUpdate files if flag setEnd IfEnd If
End If
# Example 2 - Transfer datafile 1 to datafile 2Open data filepOrders.df1,pOrders1
If flag trueSet main filefOrdersFind firstonfOrders.OrderNumWhile flag truePrepare for insert with current valuesOpen data filepOrders2.df1,pOrders2Update files if flag setOpen data filepOrders.df1,pOrders1NextonfOrders.OrderNumEnd While
End If
# Example 3 - Open a data file on a specific ODB serverOpen data fileodb://127.0.0.1:5900:test
# Example 4 - Open a data file using the ODB server identified by $prefs.$odbserverOpen data fileodb://test