The in situ ligand 2,3-pyrazinedicarboxylic acid (2,3-H2pzdc) mixed with 1,1′-(1,4-butanediyl)bis(benzimidazole) (bbbi) is used to form two coordination polymers ([Cd(2,3-pzdc)(bbbi)] (1) and [Cd2Cl3(2-pzc)(bbbi)2] (2)) under hydrothermal conditions. Complex 1 was obtained in the absence of in situ reaction and 2 was synthesized with 2,3-H2pzdc in situ generating 2-pyrazinecarboxylate (2-pzc−). The structural details reveal that 1 has a 3D framework with dia topology, and 2 is a 2D layer structure and develops a 3D supramolecular structure via strong π⋯π stacking interactions. The ligand effects were compared for the two frameworks. In addition, fluorescence properties and thermal stabilities of 1 and 2 in the solid were studied.