Creating Membership Directory using Views in Drupal 7
If you have separate databases then you need to enable CiviCRM Drupal views integration you need to add some information to the sites settings.php file.

Visit - /civicrm/admin/setting/uf?reset=1

Data from the above CiviCRM page needs to be copied and pasted into your sites settings.php file.

Detailed info can be found here