Connection String (?)

Specifies information about the ODBC data source and the means of connecting to it.

A Connection String includes attributes such as the name of the driver to be used, address of the server and/or database or file names, security information such as user name and password, as well as other configuration parameters pertaining to the data source connection. It is passed in code to an underlying driver or provider in order to initiate the connection.

For example, to connect to an Excel spreadsheet via ODBC, use a connection string that looks like this:

Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=C:\MyExcel.xlsx;

(The 64-bit version of the Microsoft Access Database Engine 2010 Redistributable must be installed on the CW host system).

To connect to a remote MySQL database, use a connection string that looks like the following:

Driver={MySQL ODBC 5.2 Unicode Driver};Server=server_hostname;Database=database_name;

(The 64-bit version of the MySQL Connector/ODBC driver must be installed on the CW host system).

It is possible to connect to many more types of data sources and a wide range of configuration parameters are supported depending on the data source. For a comprehensive reference, see www.connectionstrings.com.

In addition to the Connection String, it is also necessary to specify a suitable SQL Query to properly receive data from an ODBC source.


See Also: ODBC Data Source, SQL QueryODBC Troubleshooting.