You are here: Problem with COM on just one machine? « PHP Programming Language « IT news, forums, messages
Problem with COM on just one machine?

Posted by planetthoughtful on 02/02/07 03:41

Hi All,

Running PHP 5.1.6 on a Windows Server 2003 machine, running as a CGI
under IIS 6. I call a class in each of my pages that performs an LDAP
query to automatically look up user name / email / other details (this
is taking place on a company intranet).

This works fine on every machine tested, except 1 - on which the code
throws the following error:

Fatal error: Uncaught exception 'com_exception' with message
'<b>Source:</b> Provider<br/><b>Description:</b> Table does not
exist.' in D:\inetpub\wwwroot\itracker\include\classes.php:59 Stack
trace: #0 D:\inetpub\wwwroot\itracker\include\classes.php(59): com-
>Execute() #1 D:\inetpub\wwwroot\itracker\index.php(9):
visitor_details->perform_lookup() #2 {main} thrown in D:\inetpub
\wwwroot\itracker\include\classes.php on line 59

The code being executed is this:

$myid = $_SERVER["LOGON_USER"];
$this->userid = $myid;
$conn = New COM("ADODB.Connection");
$rs = New COM("ADODB.Recordset");
$com = New COM("ADODB.Command");
$conn->Provider = "ADsDSOObject";
$conn->Open("Active Directory Provider");
$com->ActiveConnection = $conn;
$str = "SELECT sn, givenname, mail FROM 'LDAP://
DC=core,DC=dir,DC=mycompany,DC=com' WHERE objectCategory = 'Person'
AND objectClass = 'user' AND samAccountname = '$myid'";
$com->CommandText = $str;
$rs = $com->Execute();

The error is on the $com->Execute() line. I've tried hard-encoding the
id into the query (works on every machine other than the one throwing
the above error).

I'm confused, because as I understand it, this code is running on the
server machine, not on the client machines (unless there's something
different about COM?), and there should be no reason that the page
returns the expected result on my machine and returns the error on the
problematic one. I would have thought we should both work or both
fail, particularly when I hard code the variable values to take any
variability out.

Can anyone give me any help figuring this out?

Many thanks in advance,

pt

 

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

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