I'm not having much luck here.

 I've created a MS Access database that has a linked table to an Exchange 2000 public 
folder.  When I access this database (MS Access) with PHP, it works fine with the 
table imported, but when linked to Exchange, PHP returns: 

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Not a valid account name 
or password., SQL state 08004 in SQLExecDirect in C:\FoxServ\www\linkdata\testme.php 
on line 11

Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in 
C:\FoxServ\www\linkdata\testme.php on line 13

Here's the code, any ideas.

<?
     $user = "";
     $password = "";
     $dsn="exchlink";
     if (!($conn = @odbc_connect($dsn,$user,$password)))
     {
         echo "Could not connect to the database at this time.";
         exit();
     }
     $sql = "SELECT Company,Last,First from sgcontacts ORDER BY Company,Last,First";
     $result = odbc_exec($conn,$sql);

     while (odbc_fetch_row($result))
     {
         $company = odbc_result($result,"Company");
         $last = odbc_result($result,"Last");
         $first = odbc_result($result,"First");
         echo $company . " " . $last . " " . $first . "<br>";
     }
?>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to