About the only way for this to work is
- Create a database password then when using the wizard you should be prompted for a password. Store the database connection string in app.config encrypted.
- Store user name and password in the database
Code sample for Access
/VB
- Frontend
- Class project for login logic
- Class project for encrypting app.config
For SQL-Server
which is more work but with that better security. See my TechNet article for more details
SQL Server database login for Windows Forms
- C# sample - uses SqlCredential
- VB sample
When a database is protected by a password and Visual Studio wizard is used Visual Studio will prompt for credentials. For me with SQL-Server when working with a group in an company AD group for permissions can be a decent option while for individuals setting up users in SQL-Server or via Windows authentication is best and again Visual Studio will respect that.
Have not worked with MS-Access in years so not sure if Visual Studio will allow you to store the password when setting up a data source in Server Explorer
but will for SQL-Server and Oracle.