If there's only one database you can do this: bd.Open(_T("Your-DSN"),FALSE, FALSE, _T("ODBC;UID=yourUserName;PWD=yourPass;Database=yourDb")); if (bd.IsOpen()) // it's ok else { // error } If you want the user to select a database you can let him choose from a list (but not the one opened by ODBC). Then you try to open the connection with the database selected by the user with the code above. If there's any error you display an error message. ----- We are what we repeatedly do. Excellence, then, is not an act, but a habit.