I Solve It... Hi Guys, I had the same problem few months ago, after reading some similar posts and trying all suggestions I finally took my D40X to Nikon, they spent two weeks in diagnostics to finally said that will cost me 150$ and 6 more weeks, I got my camera back and I try it and it was working perfectly.. but...yesterday, after some months I got the same error, and here is the solution .
I took off the 8 screws at the botton plate and the screw hidden at the edge near the batery (you have to take off the battery).
After taking off the botton plate I saw a red gearwheel and I move it in any direction.. then I put the battery and Viola!!.. worked... then I put back the botton plate... seems that the gear is part of the mechanics of the shutter that probably was stuck.
I Hope this helps, but remember my D40X was out of guaranty, because of that I dared to open it.
Regards