We study the adsorption of homogeneous or heterogeneous polymers onto heterogeneous planar surfaces with exponentially decaying site-site correlations, using a variational reference system approach. As a main result, we derive simple equations for the adsorption-desorption transition line. We show that it is preferable to have a small amount of strongly adsorbing sites or monomers rather than a greater amount of weakly adsorbing ones. The results are discussed with respect to their implications for the physics of molecular recognition.