Strange power problem

when i attach grd then every thing is okey but when i attach vcc it takes power which is provided for motor to arduino

What is "grd"?
Could you maybe rephrase your question, post a sketch, show a schematic?