By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,719 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,719 IT Pros & Developers. It's quick & easy.

Problem with COM on just one machine?

P: n/a
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:</bProvider<br/><b>Description:</bTable 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

Feb 2 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Feb 2, 1:41 pm, "planetthoughtful" <planetthought...@gmail.com>
wrote:
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.
Hi All,

In case anyone's interested, or in case this is of help to someone in
future, the fix for my problem was changing the string used for the
LDAP server from:

$str = "SELECT sn, givenname, mail FROM 'LDAP://
DC=core,DC=dir,DC=mycompany,DC=com' WHERE objectCategory = 'Person'
AND objectClass = 'user' AND samAccountname = '$myid'";
To:

$str = "SELECT sn, givenname, mail FROM 'LDAP://
core.dir.mycompany.com' WHERE objectCategory = 'Person' AND
objectClass = 'user' AND samAccountname = '$myid'";

(Note: in case it isn't evident, "mycompany" is not a real value)

I still have no idea why the first string worked on all client
machines but one, and why the second string works on all (tested)
machines. I was under the impression this would all happen on the
server machine. Still, there it is.

Again, hope this helps someone else.

pt

Feb 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.