The connection between resonant metastable states and bound states with changing potential strength in the presence of a Coulomb potential is fundamentally different from the case of short-range potentials. This phenomenon is central to the physics of dissociative recombination of electrons with molecular cations. Here, it is verified computationally that there is no direct connection between the resonance pole of the S-matrix and any pole in the bound state spectrum. A detailed analysis is presented of the analytic structure of the scattering matrix, in which the resonance pole remains distinct in the complex k-plane while a new state appears in the bound state spectrum. A formulation of quantum-defect theory is developed based on the scattering matrix, which nonetheless exposes a close analytic relation between the resonant and bound state poles and thereby reveals the connection between quantum-defect theory and analytic S-matrix theory in the complex energy and momentum planes. One-channel and multichannel versions of the expressions with numerical examples for simple models are given, and the formalism is applied to give a unified picture of ab initio electronic structure and scattering calculations for e-O2+ and e-H2+ scattering.