Using a two-dimensional, dissipative magnetohydrodynamic model, this paper presents a numerical simulation of the magnetic energy buildup in a quadrupolar field by photospheric shear motion. When electric current density is larger than a certain critical value, an anomalous resistivity is introduced in order to account for the dissipation caused by instabilities in high current regions. It is shown that like a bipolar field, a quadrupolar field can efficiently store magnetic free energy through photospheric shear motion. Electric current formed by shear concentrates on the separatrix and magnetic loops rooted in areas where the shear velocity gradient is large. The atmosphere is heated by anomalous resistive dissipation during the shear. Both magnetic and thermal energy increases nonlinearly with shearing displacement. When the anomalous resistivity increases or the critical current density decreases, the growth rate reduces for magnetic energy but goes up for thermal energy.