Prompt for username and password using SQL Native Client ODBC

Connection string

This SQL Native Client 9.0 ODBC Driver connection string can be used for connections to SQL Server 2005, SQL Server 2000 and SQL Server 7.0.

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 "Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;"