Skip to content

TSTool / Command / OpenDataStore


Overview

This command has initially been developed to work with SQLite. Support for other databases will be added and tested over time.

The OpenDataStore command dynamically opens a database datastore. This command is useful for a dynamic database connection that does not need to be open throughout a TSTool session, such as when working with SQLite file database. If a matching open datastore exists, it will by default be closed before the datastore is reopened. See also the CloseDataStore command.

Datastores that are needed throughout a TSTool session should be configured with a datastore configuration file to connect at startup, which allows TSTool to initialize main user interface query filters.

The status of datastores can be shown in TSTool using the View / Datastores menu as shown in the following figure (the Status Message column on the far right, not visible in the figure, provides additional information about the datastore):

View_Datastores

Datastore Information from View / Datastores (see also the full-size image)

Command Editor

The following dialog is used to edit the command and illustrates the syntax of the command.

OpenDataStore

OpenDataStore Command Editor using Properties (see also the full-size image)

OpenDataStore-config

OpenDataStore Command Editor using Configuration File (see also the full-size image)

Command Syntax

The command syntax is as follows:

OpenDataStore(Parameter="Value",...)

Command Parameters

Parameter                                    Description Default                           
DataStoreName The name of the database datastore to open. None – must be specified.
DataStoreDescription The description of the database datastore to open. DataStoreName
DataStoreType The datastore type, which indicates the software interface to use for the database, currently limited to:
  • GenericDatabaseDataStore
GenericDatabaseDataStore
DatabaseEngine The database software:
  • Access - Microsoft Access
  • Derby - Java built-in database
  • MySQL
  • Oracle
  • PostgreSQL
  • SQLite
  • SQLServer
SQLite
ServerName Database server name as recognized name on network or IP address. Additional details for DatabaseEngine are:
  • SQLite - specify the relative or absolute path to the existing database file.
None - must be specified
DatabaseName Database name. Additional details for DatabaseEngine are:
  • SQLite - not used
Login Login for account used to connect to the database, may be a shared service account. Additional details for DatabaseEngine are:
  • SQLite - not used unless database is locked
Password Password for account used to connect to the database, may be a shared service account. Additional details for DatabaseEngine are:
  • SQLite - not used unless database is locked
IfFound Action to be taken if an open datastore is found:
  • Close- close the datastore before reopening
  • Warn - generate a warning messge and do not reopen
  • Fail - generate a failure message and do not reopen
Close

Examples

See the automated tests.

Troubleshooting

See Also