SclCloseDatabase
Overview
This command closes the currently open database.
Synopsis
SclCloseDatabase DatabaseHandle
Description
The database whose handle is in the DatabaseHandle variable is closed.
Arguments
- DatabaseHandle
Passed by reference. This variable must contain the handle to the database that is to be closed.
Returns
$SCL_TRUE if the database was successfully closed. A TCL error is thrown if an error occurs when closing the database. The only reason for an error when closing the database is if the variable does not contain a valid database handle.
Examples
if {"[catch {SclOpenDatabase DatabaseHandle "woody.ddb"}]" != 0} {
puts "Error opening the woody.ddb database"
} else {
puts "Database woody.ddb successfully opened"
}
SclCloseDatabase DatabaseHandle
puts "Database woody successfully closed"
|
#
# Get the handle to a currently open database and if there is a
# database presently open close it
#
if {[sclDatabases SclCountItems] < 1} {
error "No databases are connected"
}
# get the handle to the database
sclDatabases SclGetItem DatabaseHandle 0
# get the name of the database
set name [$DatabaseHandle SclGetId]
SclCloseDatabase DatabaseHandle
puts "Database $name successfully closed"
|