Skip to main content

Database Connections

In order to work with a database, you must first establish a SenseTalk connection with the database server, or have access to the Excel file you plan to use as a database. Eggplant Functional integrates with numerous databases using Microsoft Open Database Connectivity (ODBC), and can also refer to Excel files as databases.

For information on establishing connections with either of these connection types, see the below pages:

Database Connection Property Lists

Connections are defined in a connection property list that contains all necessary information for Eggplant Functional to communicate with the database. This is done differently depending on the connection type. See ODBC Administration or Working with Excel for further connection information.

Generic Database Connection List Properties

  • Type: Required. Specify the type of database you are connecting to. Specify: "ODBC" or "Excel".
  • Writable: Determine whether or not Eggplant Functional has write abilities for this database. Use this property to change this setting for a database. (Write abilities are enabled by default for ODBC and disabled by default for Excel.)

ODBC-Only Connection List Properties

  • DataSourceName or DSN: Required. The data source name (DSN) for your database. This is an ODBC identifier for the connection to the server and is defined in your ODBC Administrator or odbc.ini file. The odbc.ini file (and odbcinst.ini file) may be preceded by a period if they are in a user's home directory or belong to a specific user.
  • Name: The name of the database (also called a schema) to be accessed on the server referenced by the DSN.
  • User: Username component of the connection credentials, if required.
  • Password: Password component of the connection credentials, if required.

Excel-Only Connection List Properties

  • File: Required. Specify the file path for the Excel workbook that you want to refer to as a database.

Example: ODBC

This example shows what an ODBC connection definition might look like. For more information, see ODBC Administration.

setmyDBto {type:"odbc", DSN:"DataSource1", user:"root", password:""}

Example: Excel

This example shows what an excel database connection definition might look like. For more information, see Working with Excel.

setmyExcelDBto {type: "excel", file: "/<Path>/<MYExcelFile>.xlsx"} -- set the specified variable, myExcelDB, to store the contents of the referenced graExcel file and establish a SenseTalk connection.