Thank you for your question and welcome to Just Answer.
A very good way to control dental pain using over the counter medications is to alternate between taking 400 milligrams of ibuprofen (e.g., 2 tablets of Advil), and 1000 milligrams of acetaminophen (e.g., 2 tablets of extra-strength Tylenol) every 3 hours. This way you are taking medication twice as frequently and getting the benefits of two different acting pain relievers. Be careful not to use these medications if you have had previous adverse reactions to either, or if you have had gastritis or peptic ulcer disease in the past, or if you have liver disease. Anything stronger and you will need a prescription which will necessitate you talking to your dentist, physician or a visit to the ER.
In addition, you can try "Toothache Drops" available at your pharmacy. This is clove oil (eugenol) which is very soothing to an exposed tooth. Place a drop or two on a cotton pellet and place on the tooth or on the hole of the tooth.
I hope this answers your question. If you would like to discuss this further or have any additional questions, please reply to my answer and I will get right back to you.
Sincerely, XXXXX XXXXX DDS