The "old database name" is probably still set in your wp-config.php
file unless you've changed it. If it's been changed then I don't know what's happened because WordPress only takes the connection details from that one fle and nowhere else.
It also sounds strange to me that it's getting something from the databae, but not other info. Can you tell me exactly what it is and isn't getting from the database?