company logo

Application :: resourceDatabase - Get resource database handle

Usually, the resource database, i.e. the database containing application resources ad methods, forms and others, is the dictionary of the database, i.e. dictionary and resource database are, usually, identical. Some applications, however (as ODE tools) require a resource database different from a dictionary.

In this case, the resource database for the application can be provided by calling this function. Calling this function requires, that the application has been initialized with a configuration or ini file, that contains a section with the executable name, in which a resource database has been defined. In this case, the database handle for the resource database will be returned. When no resource database has been defined, an empty (invalid) database handle will be returned.

// ini-file defining an resource database

[MyProgram]

RESOURCES=RSECT

DATA=DSECT

[RSECT]

DICTIONARY=ode.sys

DATABASE=ode.dev     // referred to as resource database

[DSECT]

DICTIONARY=ode.sys

RESOURCES=ode.dev    // referred to as resource database when RSECT not defined

DATABASE=MyProject.dev

Return value:  Database handle ( odaba::Database & )

The database handle refers to an (usually) opened database. Calling functions with invalid database handles may cause an exception. For checking the database handle, isValid() can be called.

Implementation details

odaba::Database & Application  :: resourceDatabase (  )