If the stored procedure sp_AcuInit exists in the master database, it is executed when the connection is made to the server. This is a procedure you can set up to perform customized initialization. This stored procedure does not take any parameters and does not return any results. This optional stored procedure is executed for all connections by the Acu4GL interface to the database, not just the primary connection.

As an example of customized initialization, you can use this stored procedure to remove stale locks by calling sp_AcuRemoveUnusedLocks_1 (which is installed when all the other Acu4GL stored procedures are installed) or to limit access to the database by certain users during certain hours. If sp_AcuInit returns an error, the connection is denied and the error is reported to the COBOL program. The method for returning an error is to execute the Transact-SQL statement “raiserror”. See your database documentation for information about Transact-SQL and stored procedures.