And besides that... you have the try/except around the wrong code. That will only trigger the except if there is no FIELD ProgID.
If you use a table which doesn't exists (like stated in your title) you need to put the sql.open (with SELECT) inside try/except. Then you can examine the exception if it contains "table not found" or something (depending on your database).
Checking beforehand with gettablenames would indeed be preferable over exceptionhandling.