Error 016-317 indicates that you need to reseat the controller card. See this page for detailed instructions -> http://support.dell.com/support/topics/global.aspx/support/dsn/en/tree?c=us&cs=04&journalid=D42990ED8ECB11DA801EE951E309CAF0&l=en&s=bsd&treeid=E1A0F91DA26EF1EAE030A68F272813FC
Does your database application generate and send its own PCL or PS directly to the printer? Also, are you printing via a >7ft paralell cable. If its the former, then the application is sending the printer a PCL command it doesnt understand and puts the printer in a mode where it cant recover, if its the latter. I recommend a 100baseTX connection instead.
We also encountered this same error ( 016-302 ) on our 5100cn. It went away when the network connection was removed - so that gave me a clue. The thing that caused it was a combination of a bad .PPT ( powerpoint ) slide file created in Office 2003 / 2007 that was sent to the printer, and old firmware. Updating the Firmware to A06 ( 200610231537 ) solved the problems. NOTE: even though it seems that the program is "locked-up" while waiting for the NEXT button to appear ( you can keep Refreshing it ), you MUST give it several minutes AFTER it resets from the 1st part of the firmware update ( as it's a 2 part Firmware update !!! ), so that it can also reprogram the MCU in the 2nd part of the update proceedure.