When my primer flakes off easily how will it help hold the paint
You need to make sure whatever you use is a "DTM" primer - direct-to-metal. The instructions on the can are usually awful, so you should check out the manufacturer's website. 

If you're using the right primer and having adhesion issues, the most common cause is probably not prepping the surface properly before applying the primer. Usually you need to wash very thoroughly (if you paint dirt, the paint will only be adhered as well as the dirt is), followed by a sanding or scuffing. Again ,the manufacturer's website will give you directions.

If you need to use emery paper to remove it, I'd say you're OK. It it comes off with a wipe down with a cloth I'd say that's a problem. Emery is an abrasive designed to remove material, after all.

As an aside, if you have an iron structure you want to protect from corrosion, I'd look at products from POR-15. They make some very nice corrosion resistant coatings. I'd also have recommended a 2k epoxy primer but it sounds like you're past that point already.

EDIT: Oops, I didn't notice how old this one was. Well, I hope whatever the O Pwould up doing worked out well :)