So this is only a problem when you have the other connection file include on the home page for the store correct?
The reason you are having this problem is because the connection files use the same variable names:
$database_localhost
These values are referenced on the page and whatever the last connection file to load is that connection files value will be used. So in the case of a database variable if the wrong db is being referenced then the table you are attempting to work with may not exist.
If I were in your situation I would create a new database that combines all of the tables from the other two, then copy one of the connection files and specify my new db in there. Always make sure to backup existing files and don't delete the other db's in case you need to get back to them for some reason.
If you had all of the info in a single db you could use just one connection file and not have any problems with conflicting values. If you were to do it this way the new connection file should be copied to both the CMS and PowerStore locations so that these pages remain working as they did.