KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to assign an IP Address to a Compiled Database
PRODUCT: 4D | VERSION: 6.7 | PLATFORM: Mac & Win
Published On: July 27, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

For a computer with multiple IP addresses, if you want to have 4D's built-in Web server listen on a specific IP address in a compiled database, you will need to use the command SET DATABASE PARAMETER. It allows you to modify, for the current process, various internal parameters of the 4D database including the IP Address to listen on. In your On Startup and/or On Server Startup Database Methods call this command and assign the desired IP Address to the database procedurally.

You must pass a hexadecimal IP address in the parameter. That is, to designate a IP address such as "a.b.c.d", you would write:

C_LONGINT($addr)
$addr:=($a<<24)|($b<<16)|($c<<8)|$d
SET DATABASE PARAMETER(IP Address to listen;$addr)