Shutting Down a Database Using InterBase Services

From InterBase

Go Up to Setting Database Properties Using InterBase Services


Use the ShutdownDatabase method of the TIBConfigService component to shut down the database (or perform an action of type TShutdownMode and shut down the database) after a specified number of seconds.

The database shutdown options are:

Shutdown Mode Meaning

Forced

Shut down the database after the specified number of seconds; to shut down the database immediately, set the shutdown interval to 0.

DenyTransaction

Deny new transactions and shut down the database after the specified number of seconds; if transactions are active after the shutdown interval has expired, the shutdown will fail; to shut down the database immediately, set the shutdown interval to 0.

DenyAttachment

Deny new attachments and shut down the database after the specified number of seconds; if attachments are active after the shutdown interval has expired, the shutdown will fail; to shut down the database immediately, set the shutdown interval to 0.

For example, you could use radio buttons to select the shut down mode and an Edit component to specify the number of seconds before shutting down a database:

if RadioButton1.Checked then
  ShutdownDatabase(Forced, (StrToInt(Edit4.Text)));
if RadioButton2.Checked then
  ShutdownDatabase(DenyTransaction,(StrToInt(Edit4.Text)));
if RadioButton3.Checked then
  ShutdownDatabase(DenyAttachment,(StrToInt(Edit4.Text)));

For more information, refer to “Database shutdown and restart” in the Operations Guide.

Advance To: