Attach a database file on connect to a local SQL Server Express instance using MSOLEDBSQL

Connection string

This Microsoft OLE DB Driver for SQL Server connection string can be used for connections to SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014 and SQL Server 2012.

Provider=MSOLEDBSQL;Server=.\SQLExpress;AttachDBFilename=c:\asd\qwe\mydbfile.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.