OP Find 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 6.0 (Modified)


OP Find 4D Server (netCompID; serverName; serverID) Longint

ParameterTypeDescription
netCompIDLongintNetwork component reference number
serverNameStringName of server to find
serverIDLongintUnique ID for found server
Function resultLongintError code result for the function

Description

OP Find 4D Server searches for the database specified by netCompID and serverName.

To find a server using TCP/IP, serverName should be equal to the IP address of the server's computer. For example, you should pass the following for a database published on the IP address 192.9.200.13:

   "192.9.200.13"

The server reference number is returned in serverID. You then pass this reference number to OP Open connection to open a connection to the selected database.

Error Codes

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

Error CodeDescription
-108Not enough memory to perform this operation.
-10021No server was found while using OP Find 4D Server.
10128The 4D Open for 4th Dimension plug-in 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 finds a 4D Server database located at a specific IP address, and opens the connection.

   C_STRING(80;$IPAddress)
   C_LONGINT($Tcp;$ErrCode;$ServerID;vConnectID)

   $IPAddress:="192.168.20.30"
   $Tcp:=GetCompID ("TCP/IP")
   $ErrCode:=OP Find 4D Server ($Tcp;$IPAddress;$ServerID)
   $ErrCode:=OP Open connection ($ServerID;vConnectID;"Arnaud's P4";"Marcel Chombier";"";"DataSync")

      `… perform operations on the server

   $ErrCode:=OP Close connection (vConnectID)
   $ErrCode:=OP Delete 4D Server ($ServerID)

See Also

OP Delete 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