To be honest I do not understand your code. Why do you need the "Tag" of the components?
In the attachment you can find a quick and dirty demo how to iterate through the components on a form and to write their names to a listbox or to a sqlite3 database (sorry I don't have access to MySQL, but the code should be very similar).