Two photochromic Cd(II)-CPs were obtained based on the viologen ligand using different synthetic routes, named {[Cd4(p-BDC)4(CPB)2(H2O)2]·2H2O·EtOH}n (1) and {[Cd(p-BDC)(CPB)(H2O)]·(L)·DMF}n (2) (p-H2BDC = 1,4-benzene-dicarboxylate, HCPB·Cl = 1-(4-carboxyphenyl)-4,4′-bipyridinium·Cl, L = 2,4-dinitrochlorobenzene, DMF...