Three cadmium–organic frameworks [Cd(L)(DMF)(H2O)]·H2O (1), [Cd(L)(H2O)2]2·5H2O (2) and [Cd2(L)2(H2O)2]2·H2O (3) and two zinc complexes [Zn(L)] (4) and [Zn(L)(H2O)] (5) [H2L = 5-(imidazol-1-ylmethyl)isophthalic acid, DMF = N,N-dimethylformamide] have been synthesized and characterized by single crystal X-ray structure determination, IR, elemental analysis, and powder X-ray diffraction. Both these two series of complexes exhibit structural diversity, which was controlled by non-innocent alkaline reagents. Within the cadmium series, the in situ generated dimethylamine from DMF, NaOH and carbonate salt were utilized as the basic reagents for the syntheses of 1, 2 and 3, respectively. As a result, 1 has a 1D ladder structure, 2 is a uninodal 3-connected 2D (63) network and 3 displays a binodal (3,6)-connected 3D framework with (4.62)2(42.610.83) topology. Within the zinc series, tetrabutylammonium hydroxide and carbonate salt were used for the syntheses of 4 and 5, respectively. 4 showed a binodal (3,6)-connected 2D kgd net with [(43)2(46.66.83)] topology; while 5 is a 2-fold interpenetrated 3D (10, 3)-a architecture. The adsorption and luminescent properties of the complexes were investigated.