Hi Vidette,
The easiest way to do this is to add a connection to that table in the database as a secondary DOM connection and then make a UserName and Password node on another XML-based secondary DOM. AFter this add a button that see if the name/pwd combo exists in the secondary DOM and then if so, switches views.
However, this will be brutally insecure as you will be piping every user's name/password down unencrypted. A simple user might not realize that they could quite easily get at these, but anyone that knows anything about InfoPath and has the desire for everyone's password could easily access these.
Unless, of course, you stored the passwords encrypted in the database (which is best practice) and ship them down to InfoPath that way. However, for this you'll have to add code to encrypt the plaintext typed by the user and then compare to the passwords retrieved from SQL.
PS - Make the font color the same as the background color for password fields.
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge