Try probiotics, like accidophilus and lactobaccilus, to get the good bacteria back in check and able to fight bad bacteria.
I had terrible diahrrea and gas to go along with it, (IBS) after my gallbadder surgery,... continuing 10 years. Then recently I had a new root canal and it seemed infected. The Dentist gave me MEGA doses of broad spectrum antibiotic, and it wiped out my IBS. I must have had a virulent bacterial infection in the gut (even though I had my stool tested a year earlier and the result was normal) .
Gas is created from the breakdown of material, including material that pathogens are ingesting and releasing. Bacterial infections and parasites can cause excessive gas. Pathogenic yeast overgrowth called candida, creates large amounts of gas due to rapid fermentation when it eats sugars (think of when it's raising bread dough.) What does candida love? Milk sugars especially, and other carbs, including high fructose corn syrup.
Carbs that don't get fully broken down in the small intestine by pancreatic enzymes move into the large intestine and get further broken down by bacteria. Possibly the introduction of pancreatic enzymes can help with the gas too.
Go online and look up candida overgrowth. Caprylic acid and GSE are suppose to be effective in fighting it, along with many others. I think with the american diet nowadays, most people have candida overgrowth. Drastically reducing or eliminating cow's milk could give you a good initial response.