Attach a database file on connect to a local SQL Server Express instance using ODBC Driver 11 for SQL Server

Connection string

This Microsoft ODBC Driver 11 for SQL Server connection string can be used for connections to SQL Server 2014, SQL Server 2012, SQL Server 2008 and SQL Server 2005.

Driver={ODBC Driver 11 for SQL Server};Server=.\SQLExpress;
AttachDBFileName
=c:\dir\\mydb.mdf;
Database=dbName;Trusted_Connection=yes;

Why is the Database parameter needed? If the named database have already been attached, SQL Server does not reattach it. It uses the attached database as the default for the connection.