Prompt for username and password using SQLNCLI11 OLEDB

Connection string

This SQL Server Native Client 11.0 OLE DB Provider connection string can be used for connections to SQL Server 2012, SQL Server 2008 and SQL Server 2005.

This one is a bit tricky. First you need to set the connection object's Prompt property to adPromptAlways. Then use the connection string to connect to the database.

oConn.Properties("Prompt") = adPromptAlways

oConn.Open "Provider=SQLNCLI11;Server=myServerAddress;DataBase=myDataBase;"