Now that you mention it, I did have to up my midi buffer from 500 to 750 in Sonar preferences recently, to avoid occasional dropped midi notes . . . but your issue seems much worse, not being able to play or record any midi ?
Surely there must be something else going on, can you give more information about your system, and specifically audio / midi interface device ?