GET THE A700. It is LEAGUES beyond the other 2, the D40 is nikons barely entry line, the Rebel is Canon's OLD entry level, the A700 is sonys top dog (not entry level by any means) - it competes with the Nikon D300 and the Canon 5D. It is absolutely no competition between the 3 you mentioned...
I am however skeptical, maybe you meant to say A200 or A300.... In which case I would still go with either of those sony's. A more fair comparison would be the Sony A100 to the Rebel XTi, at which point the Nikon is still beaten out. The a700 is certainly not "entry level", and $750 is half of what its actually going for.