If you plan to set any Informix environment variables with ifx_putenv(), have the application set all of them before it calls any other ESQL/C library routine, including ifx_getenv(), or any SQL statement. The first call to any other ESQL/C library routine or SQL statement requires initialization of the GLS locales. This initialization loads and freezes the values of CLIENT_LOCALE, DB_LOCALE, and the DATE, TIME, and DATETIME formatting values.
Figure 1-29 shows a dialog box that a client application might use to obtain network parameters from an end user. This application takes the account information that the user enters and sets the appropriate network values in the InetLogin structure.
Figure 1-30 shows a code fragment that sets login values in the InetLogin structure. The application could obtain these values from the end user through a dialog box (such as the one in Figure 1-29).
In Figure 1-30, if the user enters host information, the fragment sets the InetLogin.Host and InetLogin.User fields for the mainsrvr database server to the user-specified names of the host name and user name, respectively. If the user does not enter host information, ESQL/C uses the HOST and USER Registry values from the subkey for the mainsrvr database server.