You need to post an actual error message "it will not open" is not very useful. From your original post, I think you are saying that the metadata.db file in your calibre library is corrupted and the repair is failing. If that is the case simply delete the metadata.db file and restart calibre. Now the list of books will be blank and you can restore it as described here:
http://manual.calibre-ebook.com/faq....libre-is-blank