4D v14.3

Opening a local database

Home

 
4D v14.3
Opening a local database

Opening a local database  


 

The standard Open dialog box lets you select any 4D database and provides several opening options.

To open an existing database using the Open dialog box:

  1. Select Open > Local Database... in the File menu of 4D or Local Database... in the menu associated with the “Open” button of the 4D tool bar.
    The Open dialog box appears:
  2. Select the database to open.
    • Under Windows, you must select the database structure file (suffixed .4DB or .4DC).
    • Under Mac OS, you can select either the database package (suffixed .4dbase), or the database structure file (suffixed .4DB or .4DC). For more information about package architecture, refer to .4dbase Extension.
    • You can also select a .4DLink type access file. 4DLink files store the parameters needed for database opening (address, identifiers, etc.). They function with local and remote databases. For more information about creating and using 4DLink files, refer to Connecting to a 4D Server Database in the 4D Server Reference Manual.
  3. Choose an opening option (see the next paragraph) or click on Open to open the database.

Note: You can use drag and drop functions or double-click on a .4dbase package, a .4DB or .4DC structure file or a .4DLink file in order to launch a 4D application without passing through the Open dialog box.

In addition to standard system options, the Open dialog box in 4D provides two menus of specific options that are available using the Open button and the Data file menu.

  • Open: The menu associated with this button specifies the opening mode of the database. It includes the Interpreted Database and/or Compiled Database options as well as the Maintenance Security Center:

    • Interpreted Database and Compiled Database: These two options are available when the selected database contains both interpreted and compiled code. If one of these modes is not available (database not compiled or not recompiled, compiled file only, etc.), its corresponding option will not appear.
    • Maintenance Security Center: Opening in secure mode allowing access to damaged databases in order to perform any necessary repairs. For more information, refer to Display in maintenance mode.

When you click directly on the Open button, the database is opened in the last opening mode used.

  • Data file: This menu specifies the data file to be used with the database. By default, the Current data file option is selected. The database opens with this file is you click on Open. You can display the location of this file on your disk in a system window by clicking on the button.
    This menu includes two additional options since 4D allows you to use the same structure file with different data files.
    • Choose another data file: This option opens the database with an existing data file other than the current one. When you select this option and then click on Open, the standard Open data file dialog box appears so that you can designate a data file.
    • Create a new data file: This option lets you create a blank data file for the database. When you select this option and then click on Open, the standard Save data file dialog box appears so that you can name and indicate the location of the data file to be created.
    Once you have changed the current data file, 4D opens it by default subsequently, unless it finds a file with same name as the structure file followed by “.4DD” located in the same directory as the structure file. If you move or rename the data file, you will need to locate it again.

It is possible to change the data file using a keyboard shortcut on database startup. For more information, refer to Changing the data file.
You can view the current data file of the database at any time on the LIST OF STYLE SHEETS of the Maintenance and security center.

4D offers several functions that let you open databases directly, without passing through the Open dialog box: drag and drop, the “Open Recent Databases” menu and automatic opening of the last database used.

To open a database using drag and drop:

  1. Select the database file to be opened and drop it onto the 4D application icon.
    • Under Windows, you must select the database structure file (suffixed .4DB or .4DC).
    • Under Mac OS, you can select either the database package (suffixed .4dbase), or the database structure file (suffixed .4DB or .4DC). For more information about package architecture, refer to .4dbase Extension.
    • On both platforms, you can select a .4DLink access file.

To open a recently used database:

  1. Select Open Recent Databases > Database Name in the 4D File menu or in the menu associated with the “Open” button of the 4D tool bar.
    When the application is launched for the first time, this menu is empty. It will be filled in gradually as different local or remote databases are used; 4D automatically stores the names and locations of all databases that are opened.
    Select the Clear Menu command (only available in the File menu) to remove all the database names from the menu.

To automatically open the last database used:

  1. Display the “General” page of the Preferences.
    For more information about displaying the Preferences, refer to the Access section in the Preferences.
  2. In the “Options” area, choose Open last used database in the “At start up” menu.

4D will then automatically open the last database used each time the application is launched.   

Note: To force the display of the Open dialog box when this option has been selected, hold down the Alt (Windows) or Option (Mac OS) key while the application opens.

 
PROPERTIES 

Product: 4D
Theme: Managing 4D files

 
TAGS 

4DLink, 4DLink file, .4DLink

 
ARTICLE USAGE

4D Design Reference ( 4D v14 R2)
4D Design Reference ( 4D v12.4)
4D Design Reference ( 4D v13.4)
4D Design Reference ( 4D v14 R3)
4D Design Reference ( 4D v14.3)
4D Design Reference ( 4D v14 R4)