Setting up ODBC
The ODBC technology is available for many database/platform combinations. It relies on a driver manager that is used as an interface between applications (like mmodbc) and a data source that is accessed through a dedicated driver. The Mosel module mmodbc provides an interface to ODBC, it does not contain any drivers or driver managers. These must therefore be installed and set up on the operating system before this module can be used.
Under Windows, usually the driver manager is part of the system and most data sources (e.g., MS Access, MS Excel, SQLserver) are provided with their ODBC driver. The ODBC drivers are set up as User Data Source in the ODBC Data Source Administrator. To check which drivers are set up under Windows (2000 or more recent) select Start » Settings » Control Panel » Administrative Tools » Data Sources (ODBC). For example, for MS Access there should be a data source named MS Access Database (this name is refered to in ODBC as DSN, the data source name). If the drivers are not set up, you may add the DSN for Access by clicking Add and selecting Microsoft Access Driver (*.mdb, *.accdb).
On the other supported operating systems it may be necessary to install a driver manager as well as the required driver(s). The module mmodbc supports two driver managers: iODBC (http://www.iodbc.org) and unixODBC (http://www.unixodbc.org). The module initialization succeeds only if one of these two driver managers is installed and can be accessed (in general this requires updating some environment variables). In addition, you must make sure that the ODBC driver for the data source you wish to use is installed. For the database MySQL, for instance, you can download the required ODBC driver, MyODBC, from http://dev.mysql.com/downloads/connector/odbc.
ODBC connection strings in Mosel
When connecting to a database from a Mosel model the filename is given in the form of a connection string that consists of the DSN and the name of the external data source (abbreviated as DBQ (Windows) or DB), such as 'DSN=mysql;DB=data' or 'DSN=MS Access Database;DBQ=C:/xpress/examples/data.mdb'. Please note that some databases do not accept blank spaces in the connection string.
Under Windows it is not necessary to state explicitely the DSN in the connection string since Mosel will automatically locate the appropriate driver (if it is installed). We may therefore work with connection strings shortened to the name of the external data source, such as 'data.mdb'.
For a more general introduction to the concept of database connection strings the reader is refered to http://www.connectionstrings.com.
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.