Are you calling select() on your model? setTableName() only populates the headers, but does not execute a query to fetch the data.
Also:
m_pTableRecord=&pDatabase->m_Database.record(sTableName); // fetches column names
this line is scary - you are taking the address of a temporary object. m_pTableRecord becomes a dangling pointer!
Bookmarks