You are here: Re: Problem with php & com objects on hosting provider « PHP Programming Language « IT news, forums, messages
Re: Problem with php & com objects on hosting provider

Posted by jerry gitomer on 06/16/05 18:53

Ray wrote:
> Hi
>
> 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
> panel.
>
> 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...
>
> Sample::
>
> $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...
>
>
> Thanks
> Ray
>
>
Ray,
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.

HTH
Jerry

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация