Take a look at this site: http://allenbrowne.com/func-ado.html. You can use the sample to query the database for a list of tables. Hopefully this will give you an error when executing against a password protected database, so you know you'll need to skip the rest of the function.