Drupal 7 theme('pager') -> PDOException: SQLSTATE[42S02]: Base table or view not found
The error is down to the:

// Show pagination in output 
$output .= theme('pager'); 
// echo output to screen 
echo $output; 


being above db_set_active();

Not sure why this is but it fixes the problem.

Thanks