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

version 2003 (Modified)


OP Select 4D Server (netCompID; serverName; serverID; otherButton) Longint

ParameterTypeDescription
netCompIDLongintNetwork component reference number (always 2)
serverNameTextSelected server name
serverIDLongintUnique ID for selected server
otherButtonBooleanTo show or hide the "Other" button
Function resultLongintError code result for the function

Description

OP Select 4D Server allows you to graphically choose a 4D Server from the Connect to Data Server dialog box.

Pass 2 in netCompID. Starting from version 2003 of 4D Open for 4D, only the TCP/IP network component (reference number = 2) can be used.

The server name is returned in serverName. This name can be saved somewhere in the database to be later passed to OP Find 4D Server. serverName is equal to the IP address followed by a colon and the name of the database. For example, the following would be returned for a Customers DB database with the IP address 195.4.210.25:

   "195.4.210.25:Customers DB".

The server reference number is returned in serverID. This reference number is then passed to OP Open connection to open a connection to the selected database.

Error Codes

If OP Select 4D Server executes successfully, it returns 0. Otherwise, this function returns one of the following errors:

Error CodeDescription
-108Not enough memory to perform this operation.
-10020No server was selected while using OP Select 4D Server,
(the Cancel button was clicked).
2The Other button was clicked while using OP Select 4D Server.
10128The 4D Open for 4th Dimension package has not been initialized.
10129The network component was not found.
10131The network component has not been initialized.
10154This command cannot be executed right now.

Example

The following method allows you to choose a database from the list and open a connection to it.

   C_STRING(255;$Server)
   C_LONGINT($ErrCode;$ServerID)
   
     $ErrCode:=OP Select 4D Server (2;$Server;$ServerID)
 

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