Thanks for this fix – I uploaded a fresh install of WordPress today and then installed wpecommerce through the plugins and had the database error, once I copied the new code to page.php everything has worked. Thank you!
Can you please let me know how you fixed this – currently facing the issue myself. Just downloaded fresh WordPress installed perfectly, went to plugins and installed WP E-commerce and get the errors you are having.