|
||||||||||
|
||||||||||
Other Library Functions |
function | dbClose |
Library: omdb - high level database access
Include: omdb.xin |
define external function dbClose value dbDatabase database
Where:
database
The dbClose function closes an existing database connection that was created using the dbOpenODBC function, and releases the resources the database was using. Attempting to close a connection that is not open is allowed.
Under most circumstances, the dbClose function is unnecessary because the connection to the database will automatically close when the dbDatabase OMX variable you created goes out of scope.
If, however, you create a global dbDatabase OMX variable, that variable will not go out of scope until the end of the program. When your program has finished using the database, however, you can free the resources the database is using by explicitly closing the connection with the dbClose function rather than waiting for the dbDatabase OMX variable to go out of scope.
In this example, a connection to a database is opened and then immediately terminated:
include "omdb.xin" global dbDatabase my-database process set my-database to dbOpenODBC "DatabaseDemo" dbClose my-database
---- |