If that database error is not issue anymore, i have to see the error. And
Disable ALL plugins except bbpress and buddypress. If activity and other pages works properly, start to activate plugins one by one and test them. You can find problematic plugin in this way
When you do that, which plugin you found problematic?