The error "An error occurred in executing the previously prepared ODBC command." makes me think there is a problem at the database level. Do you have a copy of the application in another environment with the same metadata, data, etc.? If that works I would investigate the database logs to see if there are errors in the MS SQL or Oracle database.
We had the same issue a year or so ago. Metadata didn’t load in Dev with same error, but loaded in Prod. Reason for us is that our MS SQL DB didn’t have enough space. I think we had Auto Growth enabled but still error. We had to increase the size manually.
Please check that you have enough space on the DB, that auto growth is enabled and if necessary, increase the space manually.