Problem: If you attempt to access an Interbase database from within an NT Service App where the NT Service App runs on the same machine as the Interbase server, you will not be able to connect to the database unless the Delphi NT app is configured properly and the BDE alias is configured properly. This is also true if the NT Service app is running on a different computer from the Interbase server (as in Client/Server mode). The NT Service app must be able to run when the desktop is logged off. Solution: The information in this article applies to: ** InterBase 5.x ** Windows NT 4.0 Scope : This problem affects anyone writing an NT Service App which accesses an Interbase database. I suspect the same problem will occur if you attempt to access an Interbase database from a DCOM server app or a process invoked by the NT scheduler service. In order to have the NT Service App running with InterBase Server, the following configurations are needed: BDE Alias : The BDE alias MUST have the SERVER NAME set to be "servermachine:drive:path" Example - zeus003:C:Delphi4ProjectsMichelinPOCSocketData.gdb Tdatabase component : The Tdatabase component in the Delphi app MUST use the BDE alias. I have not tested all permutations but I do know that only using the following parameter overrides works : USER NAME=SYSDBA PASSWORD=masterkey Have prompt for login turned off. You MUST not have a SERVER NAME=path as a parameter override. Services : Interbase Guardian - Log On As : SYSTEM and interact with desktop Interbase Server - Log On As : SYSTEM and interact with desktop Your NT Service App - Log On As : SYSTEM and DO NOT interact with desktop Caveat : I know this works if you have TCP/IP as the only protocol configured on the machine. The hint from the Interbase engineer was that the communication to the Interbase server must be made over TCP/IP for this solution to work. Adding other protocols or substituting TCP/IP was not tested by me. Source by: Mike Carroll Maritime Tel & Tel
Last Modified: 20-OCT-00