Minolta frame with a Sony name over it. It's very similar to Pentax with the Samsung name over their cameras.
Given the choices between the D40X, Sony alpha, and the Rebel 400D, I'd go with the Canon, since you aren't invested in any of the glasses/hardware. Here's a quick comparison between the three on paper.
http://www.dpreview.com/reviews/compare_post.asp?method=sidebyside&cameras=nikon_d40x%2Csony_dslra100%2Ccanon_eos400d&show=all
Pros/cons of the 3:
1. CMOS vs. CCD - 400D uses CMOS vs. the CCD of the other two and is better for noise (the Sony CCD and the Nikon are very similar since Sony produces sensors for Nikon)
2. Image stabilization - Sony is built into the camera vs. on lens stabilization with Canon and Nikon
a. 2 stops stabilization on the Sony
b. 3-4 stops on the Canon/Nikon depending on which generation of IS/VR it has
3. Flash modes - Nikon's system is better than the other two
4. Exposure compensation - Nikon's is more adjustable
5. Time lapse photography - Canon is the only one w/this ability, but it needs to be hooked up to a computer/laptop
6. Flash cards - Canon/Sony both uses CF vs. the Nikon which uses SD (might not matter; I prefer CF)
7. Size and weight - The alpha is nearly 20% larger and heavier than either the Canon or Nikon
8. Integrated sensor cleaner - the 400D is the first camera with this ability
9. Lenses - Canon/Nikon lens choices are far greater and are better optically, as well as less expensive overall.
With the above in mind, it's really basically down to the Canon or the Nikon. You might save right now by jumping onto the Sony, but where do you go from there? You'll have to pay a price premium for their lenses over the other two. Always invest in lenses over bodies since lenses hold their resale value very well (typically 10% depreciation) vs. camera bodies (can drop below 50%). This goes across the board and even impacts how the D40x compares. Also, what would you have to look forward to looking at the future in case you were to upgrade? Both Canon and Nikon offers pretty clear and defined bodies that you can upgrade to; not so with Sony.
The D40x will only autofocus with AFS and AFI lenses. This limits the lenses that you can autofocus with, including the 50mm f/1.8D, 50mm f/1.4D, etc. The Canon on the other hand will do fine with both EF and EF-S mount lenses. The D40x will give you more flexibility if you want to do things manually, but if not, then the 400D would be better with most things automated (not the same as shooting in auto mode).