version 6.0 (Modified)
OP Find 4D Server (netCompID; serverName; serverID) Longint
Parameter | Type | Description | |
netCompID | Longint | Network component reference number | |
serverName | String | Name of server to find | |
serverID | Longint | Unique ID for found server | |
Function result | Longint | Error 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 Code | Description |
-108 | Not enough memory to perform this operation. |
-10021 | No server was found while using OP Find 4D Server. |
10128 | The 4D Open for 4th Dimension plug-in has not been initialized. |
10129 | The network component was not found. |
10131 | The network component has not been initialized. |
10154 | This 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.