Installation guide

3. Access Databases using mxODBC
See the ODBC File Data Source documentation for more details.
3.2.6 DSN-less Connections
If you don't want to bother setting up a data source in the ODBC manager, you
can also use a DSN-less connection setup.
Pros and Cons of using DSN-less Connections
These setups include all required driver and connection information in the
connection string itself. All connection information is thus under the control of the
application, without any system ODBC manager being aware of the connection
setup.
This has both up- and downsides. The most important downside is that changes
to the server system can no longer be administered through the ODBC manager,
but instead have to be repeated in each application using a DSN-less setup. Even
you upgrade an ODBC driver to a newer version, you may have to change all
DSN-less connection setups due to changes in the ODBC driver name.
We recommend to only use DSN-less setups if absolutely necessary, or in cases
where access to the ODBC configuration files is otherwise not possible.
DNS-less Connection String
A DNS-less connection provides all configuration information you'd normally
configure in the ODBC manager for a data source. Instead of a DSN name, you
provide a textual representation of the driver name enclosed in curly brackets, e.g.
"Driver={MySQL ODBC 3.51 Driver}; Server=mysql.example.net;
Database=mydb"
The name given in curly brackets must match the driver name as listed in the
ODBC manager (under Name on the Driver tab). The ODBC manager will then
map the name to the registered driver.
A
"DSN=mydsn" entry in the connection string is no longer needed.
For a list of common DSN-less connection strings, have a look at the
ConnectionStrings.com
website.
In order to connect to a database using a DSN-less connection string, you simply
pass the string to the
mx.ODBC.Windows.DriverConnect() API.
23