4D v16.3

Creating a new application

Home

 
4D v16.3
Creating a new application

Creating a new application  


 

 

You can create a blank database or you can create a database from a structure definition that has previously been exported. 

You create databases the same way regardless of whether it is done from the 4D application or from the 4D Server application.

You can create a blank database, i.e. that does not contain any tables, fields or forms. Its the equivalent of a blank sheet for databases. 

To create a blank database:

  1. Choose New > Database... from the File menu or from the menu associated with the “New” button in the 4D tool bar. You can also click directly on the “New” button of the tool bar.
    A standard Save as dialog box appears so that you can choose the name and location of the 4D database:
  2. Enter the name of your database and click Save.
    You can choose any file name allowed by your operating system. Warning: if your database is intended to work on other systems, you must take the specific restrictions for each of them into account. For example, "backslash" (\) characters are accepted under OS X but they are not allowed under Windows.

When you validate the dialog box, 4D closes the current database (if any), creates a folder at the location indicated (the name of the folder is the database name) and puts all the files needed for proper operation of the database into it. For more information about the architecture of 4D databases, refer to Database Architecture

The 4D application window is then displayed with the Explorer in the foreground. You can then, for example, create project forms or display the Structure editor and add tables, fields, etc.

Structure definitions that are exported in XML format can be used to create new identical databases on the fly. In this case, the structure definition can be considered as a structure template, which can be duplicated at leisure. For more information, refer to Exporting and importing structure definitions

An XML structure definition can be used as is or can be modified beforehand via an XML editor. This means that the use of any type of mechanism used to generate structures by programming can be considered.  

Furthermore, since the internal format of 4D structure definition XML files is public (see Format of a 4D structure definition), it is possible to build this type of file from other database environments or any design application in order to generate 4D databases automatically. 

To create a database from a structure definition:

  1. Select New > Database From Structure Definition... from the File menu of 4D or from the menu associated with the “New” button in the 4D tool bar.
    A standard Open document dialog box appears so that you can specify the definition file to be opened. You must select an XML format file that respects the “grammar” of 4D structure definitions (the program validates the file via the DTD). 
  2. Select a structure definition XML file then click OK.
    4D displays a dialog box that can be used to choose the name and location of the database to be created.
  3. Choose the name and location of the database to be created then click on Save.
If the XML file is valid, 4D closes the current database (if any) and creates a new structure based on the structure definition. A folder is created at the location indicated (the name of the folder is the database name) that contains all the files needed for proper operation of the new database. The Explorer window then appears.

 
PROPERTIES 

Product: 4D
Theme: Managing 4D files

 
HISTORY 

 
ARTICLE USAGE

4D Design Reference ( 4D v16)
4D Design Reference ( 4D v16.1)
4D Design Reference ( 4D v16.3)