Connect to ODBC

Verb: odbcConnect

Available from: <Standard>

Connects to an ODBC database.

Syntax

odbcConnect --connectionstring(String) (DbConnection)=connection

Inputs

Script Designer Required AcceptedTypes Description
--connectionstring Connection String Required Text Connection string used to connect to the ODBC Database.
There must be a previously configured ODBC Database.

Outputs

Script Designer AcceptedTypes Description
connection Connection Database Connection Variable that holds the connection to the ODBC database.

Example

This example connects to a database with the ODBC protocol, using the Assert Condition command to verify if the connection was successful. The message "Could not connect to the Database!" is displayed if the connection is empty.

defVar --name dbConnection --type DbConnection
// Connect to the database via the connection string and store the data in the connection variable.
odbcConnect --connectionstring "Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\\file.mdb; Uid=Admin; Pwd=; \r\n" dbConnection=connection
// Check if the connection was successful
assert --message "Could not connect to the database!" --left "${dbConnection}" --operator "Is_Null" --negate

See Also

  • Connect to MySQL
  • Connect to Oracle
  • Connect to PostgreSQL
  • Connect to SQL Server
  • Connect to SQLite