F.Y.I. NT service and Informix CLI 2.5
Posted in 1997
F.Y.I. I have done investigating the problem of a Windows NT service working with the Intersolv Informix ODBC Driver V2.12 (or Informix CLI 2.5), and I like to share this with everyone who helped me along the way. Initially, the error message "-23101 Unable to load locale categories" prompted me to post the first message in the newsgroup to find out how to set CLIENT_LOCALE and DB_LOCALE. Later I concluded that the error is caused by the ODBC driver not able to find the proper settings in the registry, specifically, values in the HKEY_CURRENT_USER\\Software\\Informix\\ENVIRONMENT key which are set by the SetNet32.exe program. In NT, each login account has its own HKEY_CURRENT_USER registry hierarchy. A Windows NT service, such as a server program that uses this ODBC driver to access Informix, is by default launched under the 'system' account, regardless whether it is started at boot time or by the Control Panel - Services icon ran in a user account. Since the HKEY_CURRENT_USER registry hierarchy for the 'system' account does not have those keys and values set by SetNet32.exe, the ODBC driver fails with that error message. The solution is quite simple: 1. Login to Windows NT as 'informix' and run SetNet32.exe to set the proper environment variables, INFORMIXDIR, etc. 2. Run Control Panel - Services icon, highlight the service in question and click on the "Startup..." button. 3. Select the "This Account:" radio button, then type in 'informix' in the edit box to the right. Also, enter and confirm the password of 'informix' in the two remaining edit boxes. 4. Click "OK". Stop and restart the service. A final note, if your NT service requires special privileges, you my consider using a special account other than 'informix' so that you don't have to assign or revoke the original security settings of the 'informix' account. --Michael