An S Corporation will not be affected but....
I found this paragraph at
http://www.bankruptcycheck.com/Topic_business.htm
If you file for personal bankruptcy and are an officer of an S corp in SC, you may be required to sell your shares at auction (if you go chapter 7) but you can bid on them yourself and get them back. Or, if the corp has little or no assets, you may not be required to do a thing since the shares you own are essentially worthless.
At least that's my interpretation....if you have found this to be untrue in your experience, please let me know as I am currently in the same situation.
Q. "What happens to my corporation if I file personal bankruptcy? "
A. "Since the corporation is a legal entity different and distinct from its shareholders, the bankruptcy of a shareholder does not affect the corporation. The bankrupt shareholder's shares in the corporation are an asset of his bankruptcy estate. The value of the shares in the hands of the bankruptcy estate is a function of the share's marketability, the percentage interest they represent of the corporation, and the net value of the corporation's assets."
Q. "What if I incorporate before I file?"
A. "Incorporating a proprietorship creates a legal entity separate from the debtor. Most trustees will not interfere in the business operations of a corporation that is owned by a debtor. If the corporation has value that is greater than any exemption claimed in the stock, the trustee may insist that the debtor either buy the stock back from the estate or that the corporation be dissolved and any value distributed to the bankruptcy estate.
In our opinion, incorporation of a sole proprietorship does not constitute a fraudulent transfer but merely a change in form of the asset held by the debtor: before incorporation, the debtor owned the business while after incorporation, the debtor owns the stock of the corporation that owns the business. Check the laws and judicial attitudes where you live."