The reactions of pyridine-2,3-dicarboxylic acid (2,3-PyDCH2) with Hg(CH3COO)2, tuned by ancillary ligands and alkaline-earth metal ions, gave [Hg2(2,3-PyDC)2]n (1), {[Hg(phen)(2,3-PyDC)]·2H2O}n (2), [CaHg(2,3-PyDC)(SCN)2(H2O)]n (3), [SrHg(2,3-PyDC)(SCN)2(H2O)]n (4) and [BaHg(2,3-PyDC)(SCN)2(H2O)]n (5). Compound 1 presents a three-dimensional topological network with the Schläfli symbol (42.64)(42.63.8)(43.66.8) (4.62), formed by two kinds of 2,3-PyDC2− ligands (five-connecting and three-connecting) and two kinds of four-connecting Hg(II) ions. The introduction of chelating 1,10-phenanthroline ancillary ligands in 2 gave one-dimensional chains. The addition of alkaline-earth metal ions and the ancillary ligand SCN− to the Hg2+–2,3-PyDC2− system gave a three-dimensional topological network with the Schläfli symbol (46.69.84)(32.42.5.65)(32.4.63)(46.62) for 3 and two-dimensional structures formed by the connection of one-dimensional Sr(II)/Ba(II)–carboxylate chains via dinuclear units [Hg2(SCN)2]2+ with the Schläfli symbol (3.82)(34.45.5.64.7)(3.42.5.6.7) for compounds 4 and 5. The photoluminescent properties of free 2,3-PyDCH2 and complexes 1–5 were investigated. They reveal no fluorescent emission (fluorescence “off” state) for free 2,3-PyDCH2 in the absence of metal ions. However, an emission band (fluorescence “on” state) was found upon the coordination of 2,3-PyDC2− to Hg2+ in 1 to giva a 3D structure. Interestingly, the addition of ancillary ligands and alkaline earth metal ions to the Hg2+–2,3-PyDC2− system results in the disappearance of the fluorescence (fluorescence “off” state) in compounds 2–5.