Use the ON CONNECT/PACK command to run a command file before or after connecting to or packing a database.
Options
AFTER
Indicates the command file should be run after the CONNECT/PACK.
BEFORE
Indicates the command file should be run before the CONNECT/PACK.
Indicates the command file should be run when connecting a database.
FIRST
Indicates the command file should be run on the first connect only.
Indicates the command file should be run when packing a database.
RESET
Clears out the ON CONNECT/PACK command recorded in the database.
Runs a command file or procedure stored within a table.
cmdfile
Specifies the name of the command file to execute.
SAVE
Specifies that the parameters in the cmdfile or from the RESET will be saved to the database. Any options without the SAVE parameters will only be active for a session.
SELECT VARCHAR clause
Specifies a column defined with the VARCHAR data type from a table, from which you can run the contents. The SELECT clause must limit the data to only one row; otherwise, an error is returned.
USING parmlist
Lists the values the command file uses when it runs. The parameter list can contain up to 18 values. The first value in the list is referenced in the executed file as %1, the second as %2, and so on through %9. They are treated just like other variables. To reference the contents of these variables, preface the variable name with a dot (.); for example, set v1 =.%1.
About the ON CONNECT/PACK command
The ON CONNECT/PACK command is useful for running a specific command file whenever a database is connected or packed. A common use would be to run a command file that does an AUTOCHK command before connecting. The ABORT ON command could then be used to cause the CONNECT/PACK to be aborted after the command file finishes.