Opening a Connection

4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next

version 1.5


Once a 4D Server database has been identified over the network, you can open a connection to it by using OP Open connection. Remember that you can open multiple connections to the same database and can open multiple databases simultaneously.

For each connection opened using OP Open connection, a new process is created on the target server. If you are using a color monitor, the new process appears in green in the 4D Server window to distinguish it from 4D Client connections. The 4D Server window is shown here:

For each user, the 4D Server window displays the name of the client station, the name of the user, and the names of the user's processes. You supply this information to OP Open connection.

Processes

The first time that you open a connection to a database from a 4D Open for 4th Dimension client, the client is registered as being connected to the database and a new process is started for the connection. If you connect to the database from the same client again, another process is added for the client. By connecting to a database several times, you can have multiple processes running under the same client.

In 4D Server, processes behave like separate connections to the same database. You may want to open several processes for the same client so that you can perform different operations in each one. For example, you might want to retrieve and display a list of records in one process and allow the user to add records in another process.

Closing a Connection

You can close a connection by using OP Close connection.

Providing Access to Non-4D Clients

In 4th Dimension and 4D Client, you can allow non-4D Client applications to access a database. A non-4D Client application can be any application that uses 4D Open to connect to a 4D Server database.

To allow non-4D Client applications to connect to a 4D Server database, you must deselect the "Allow 4D Client connections only" check box in the Database properties dialog box. This feature was added in 4D Server version 1.1.

If this check box has already been selected for a database, you will not be able to connect to the database from 4D Open for 4th Dimension. If you attempt to connect to the database, an error will be returned:

- If you are using 4D Server version 1.1, error -9956 is returned.

- If you are using 4D Server version 1.1.1 or greater, error -9947 is returned.

- If you are using 4D Server version 1.1.1, you will also receive an error if the user connecting to the database is not part of the password group designated to have 4D Open access to the database.

Providing Access Privileges to a 4D Open Group

In 4D Server version 1.1.1 or greater, the database designer can give special access to a group of users so that they can connect to the database via 4D Open.

Remember that the "Allow 4D Client connections only" check box must also be deselected to give access to users who are using 4D Open to connect to the 4D Server database. This group can be selected from the 4D Open access pop-up menu. If no groups have been created, "All Groups" is chosen by default. If one or more groups have been created, no group is selected by default. If a user is not in the group selected from the 4D Open access pop-up menu, error -9944 appears when he/she tries to connect to the database via 4D Open.

To display a connection dialog box, call OP Select 4D Server. In this case, the user can choose among a list of databases opened by 4D Server.

To find a 4D Server database on the server without the user having to select one, you can call OP Find 4D Server.

Once you have selected a 4D Server database you can open a connection to it by calling OP Open connection.

To close the connection opened with OP Open connection, call OP Close connection.

To clear the space in memory allocated (by OP Select 4D Server or OP Find 4D Server) for keeping track of the server, call OP Delete 4D Server.

See Also

OP Close connection, OP Delete 4D Server, OP Find 4D Server, OP Open connection, OP Select 4D Server.


4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next