[thelist] [php] Fatal error: Call to a member function on a non-object

Tim Burgan email at timburgan.com
Wed Dec 22 04:38:10 CST 2004


Hello,


I have a database driven (MS Access 2000) PHP website that runs fine on 
my localhost (Apache, WinXP), but when I upload it to the web host (IIS) 
and try to access a page I receive the following error:

Fatal error: Call to a member function on a non-object in 
c:\XXX\inc\dbConnOpen.php on line 17

The file in question contains code that forms a connection to the 
database. I've used this EXACT same code on this same website for the 
last 8 months with no problem.. then when I upload the WHOLE site 
again.. it doesn't work.

Here's the contents of the above file:

  /* Open database connection */
    $db_connection = new COM("ADODB.Connection") or die("Cannot start ADO");
   
    $db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" .
                   realpath("directory/database.mdb") . ";DefaultDir=" .
                   realpath("directory");
    $db_connection->open($db_connstr);      // THIS IS LINE 17


Can anyone shed some light onto what this error means in plain english, 
and possible what I can do.

Thanks for your time.. I'm in a bit of a pickle.


Cheers

Tim




More information about the thelist mailing list