AIS will work on all current Nikon DSLR bodies. It's the non-AI lenses that you have to worry about, when mounting them will cause damage.
You lose metering and autofocus w/D40(x), but that's something that you can work around. You get the hang out of it after awhile and that's how I picked up macro shooting in the beginning. I still have a 55mm f/3.5 AI micro that's actually older than I am.