Problem with php & com objects on hosting provider

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I need to access an access db via php.

My hosting provider is using php version 4.3.10 on a windows 2003 platform.
I think that php was installed with the Plesk for windows package/control

The scripts work on my dev box (winxp with iis5) but yet when I upload the
scripts to my hosting provider I get the following error

*Fatal error*: Call to a member function on a non-object in
*C:\xxx\xxx\xxxx\httpdocs\test.php* on line *12*

This error comes up when I call the database connection. I tried 2 different
connection strings including setting up and using an obdc connection both a
user and a system dsn connection but with no luck...

I am using standard php functions to connect...


$db = realpath("./data/mydatabase.mdb");

$conn = new COM("ADODB.Connection");
$rs = new COM("ADODB.Recordset");
$dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" .$db.";User
Id=ddd;Password=xxx;" ;
//$dsn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" .$db;
//$dsn="DSN = Prop"; $conn->Open($dsn);
$rs = $conn->Execute("select * from mytable");

The 3 different connection strings are defined under the $dsn variable...

Has anyone else had a similar problem to this or got a solution..

It almost sounds like php can't call on a com object...

My hosting provider can't seem to find a solution...

Any suggestions will be greatly appreciated...


Re: Problem with php & com objects on hosting provider

Ray wrote:
Quoted text here. Click to load it
Assuming your hosting provider supports a DBMS other than Access
I suggest that you look into switching instead of fighting.

Access is an excellent product -- but not on a server!  Since,
based on your example, you are familiar with SQL you would be
better off using a server product such as MS Sql Server or MySQL.


Site Timeline