4D v13

Connecting to a 4D Server Database

Home

 
4D v13
Connecting to a 4D Server Database

Connecting to a 4D Server Database  


 

 

There are three ways to connect to a 4D Server database via a remote 4D:

  • Using the connection dialog box
  • Using the Open Recent Databases menu
  • Using a 4DLink shortcut file containing the access parameters to the database.

To display the 4D Server connection dialog box, first launch the 4D application.
The Open command of the File menu (or the corresponding button in the 4D tool bar) can be used to select the opening mode for the 4D database:

Choose the Open>Remote Database... command
The 4D Server connection dialog box appears. This dialog box has three pages which can be accessed via the following tabs: Recent, Available and Custom:

If you check the Display this dialog at next startup option, this dialog box will automatically be displayed on startup of the 4D application.

Note: You can also display this dialog box by checking on the Connect to 4D Server link in the 4D Welcome dialog box.

The Recent page memorizes the list of all 4D servers recently used. The list is sorted by alphabetical order. To connect to a server from this list, double-click on its name or select it and click the OK button.

4D Server includes a built-in TCP/IP broadcasting system that publishes by default the name of the 4D Server databases available over the network. These names are listed on the TCP/IP Page of the connection dialog box.

The list is sorted by order of appearance and updated dynamically. To connect to a server from this list, double-click on its name or select it and click the OK button.

Notes:

  • A circumflex accent (^) is placed before the name of databases published with the encryption option. For more information, refer to section Encrypting Client/Server Connections.
  • It is possible to prohibit dynamic publication of the database name on the network (see the Publishing preferences section). In this case, the connection can only be carried out manually on the “Custom” page.

The Custom page allows assigning a published server on the network using its IP address and attributing it a customized name.

You can customize the 4D Server TCP/IP broadcasting system so that the names of server databases are not automatically published over the network (see the Publishing preferences section). In this case, this name does not appear on the "Available" page. However, if you know the IP address of a server database whose name is not broadcast, you can manually enter its IP address.

  • Database name: allows defining the name of the 4D Server database. This name will be used in the Recent page when referring to the database.
  • Network address: allows entering the IP address of the machine where the 4D Server was launched. If two servers are executed simultaneously on the same machine, the IP address must be followed a colon and port number, for example: 192.168.92.104:19814.
    By default, the publishing port of a 4D Server is 19813. This number can be modified in the application Preferences (see the Configuration preferences section).

Note: If a database was selected in the Recent or Available pages at the moment that you clicked on the Custom tab, the two fields display the corresponding information.

Once this page assigns a server, click the OK button will allow you to connect to the server. The server will then be listed in the Recent page.

Note: If the database is published using the encryption option, you must add a circumflex accent (^) before the name; otherwise the connection will be refused. For more information, refer to section Encrypting Client/Server Connections.

This option causes systematic updating of the local resources on the client machine when it connects. The local resources are the structural information related to the database that are stored on each client machine.

As a rule, updating of the local resources is automatic on the remote machine each time it connects, when the structure of the database has been modified between two connections. Most of the time, this option is unnecessary. Nevertheless, in certain specific cases, it may be necessary to force the update.

The Open Recent Databases menu command can be used to connect directly to a 4D Server database to which you have already connected previously.

This command is found in the 4D File menu. If you use the 4D application to open local databases and to connect to remote datatabases, this menu will list both types of databases. The remote databases are placed at the bottom of the menu:

The IP address of the server is indicated next to the database name.

The Clear Menu command can be used to reset the menu.

You can generate database access files containing parameters intended to automate and simplify opening or connecting to 4D databases. Usually, an access file can save the address of a 4D Server remote database as well as its connection identifiers, thus eliminating several operations for the user.

Access files can also be used for opening local databases.

The access files of 4D databases are XML files that have the ".4DLink" extension. 4D generates and uses this type of file to build the "recent databases" submenu: a .4DLink file is automatically generated by 4D when a local database is opened for the first time or when connecting to a server for the first time.

The .4DLink files that are created automatically by 4D are placed in the local preferences folder of the user. In this folder, two directories are created: Local and Remote. The Local folder contains the ".4DLink" files that can be used to connect to local databases and the Remote folder contains the "4DLink" files that can be used to connect to remote databases.

Local preferences folders are found at the following locations:

  • Windows Vista/Windows 7: C:\Users\UserName\AppData\Roaming\4D\Favorites vxx\
  • Windows XP: C:\Documents and Settings\UserName\Application Data\4D\Favorites vxx\
  • Mac OS: Users/UserName/Library/Preferences/4D/Favorites vxx/

... where xx designates the main version number of the 4D application. For example, for 4D v12, the local preferences folder is named Favorites v12.

The files found in these directories are displayed by 4D in the Open Recent Databases> submenu of the File menu:

The ".4DLink" files can also be created with an XML editor and contain customized information such as the connection identifiers (user name and password) or the database opening mode.

4D provides a DTD describing the XML keys that can be used to build a ".4DLink" file. This DTD is named database_link.dtd and is found in the \Resources\DTD\ subfolder of the 4D application.

A .4DLink access file can be used to launch the 4D application and open the target 4D database. There are two different ways to use it:

  • Via a double-click or drag and drop onto the 4D application,
  • Via the Open Recent Databases submenu (file located in the local preferences folder).
    A .4DLink file of the "remote database" type can be copied and used on several different machine.

Note: It is also possible to select a 4DLink file in the 4D and 4D Server opening dialog box (opening local databases only).

 
PROPERTIES 

Product: 4D
Theme: Using a remote 4D

 
TAGS 

4DLink, Fichier 4DLink, .4DLink***