ID: 25958
User updated by: brian dot garvis at mascommsys dot com
Reported By: brian dot garvis at mascommsys dot com
Status: Open
Bug Type: ODBC related
Operating System: Windows 2003 Server
PHP Version: 4.3.2
New Comment:

After working on this for the past week with anyone and everyone we
could find to help out, we are still where we started.

We have verified that MS ODBC works fine to database on local machine.
We have tried to connect to different databases on different remote
machines using both php and MS Query. MS Query has no problem
accessing remote DBase & Access databases using the same DSN's that PHP
is using. PHP to the same remote databases always returns the same
errors with a "null" "Resource ID #".


Previous Comments:
------------------------------------------------------------------------

[2003-10-23 14:34:06] brian dot garvis at mascommsys dot com

Turning on Machine-Wide tracing using odbctrac.dll in ODBC Data Source
Administrator and reproducing the problem does not create any entries
in the SQL.LOG. I did make the user "Administrator" invalid for the
shared drive and the SQL.LOG file filled quickly with errors. Errors
stopped when I added the "Administrator" user back on the shared
drive.

From my ODBC Data Source Administrator, System DSN, System Data
Sources:
Name: DEMOSASI
Driver: Microsoft dBase Driver (*.dbf)

From the ODBC dBASE Setup for DSN DEMOSASI:
Data Source Name: DEMOSASI
Database VErsion: dBase 5.0
Directory: Z:\ (mapped shared folder where DB resides on another
machine)
Driver:
Collating Sequence: ASCII
Page Timeout: 5

------------------------------------------------------------------------

[2003-10-22 19:42:18] [email]kalowskyphp.net[/email]

Please include your DSN entry, and a SQL Log for the connection attempt
if you can. From the sounds of it, you're not configured properly on
the ODBC Administrator end, and thus not a PHP bug.

------------------------------------------------------------------------

[2003-10-22 18:19:57] brian dot garvis at mascommsys dot com

Description:
------------
odbc_connect fails to connect to a Dbase 5 database which resides on a
separate Windows 2000 machine using Microsoft ODBC Data Source
Administrator. If move database to local machine and point ODBC to
local database, then works.

PHP reports error:
Warning: SQL error: [Microsoft][ODBC dBase Driver] '(unknown)' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides., SQL state
S1009 in SQLConnect in C:\DEMO\wwwroot\login.php on line 16



Reproduce code:
---------------
<?php
//Connection statement
// *** Start the session
include "./WebFront/-general includes-/functions.php";
session_start();
// *** Validate request to log in to this site.
$KT_LoginAction = $HTTP_SERVER_VARS["REQUEST_URI"];
if (isset($HTTP_POST_VARS["id"])) {
$KT_valUsername = $HTTP_POST_VARS['id'];
$KT_fldUserAuthorization = "SecurityLevel";
$KT_redirectLoginSuccess = "WebFront/Generated/Lobby.php";
$KT_redirectLoginFailed = "login.php";
$odbcSASI=odbc_connect("DEMOSASI","Administrator", "z911!ABC");
$odbcLOGIN=odbc_connect("DEMOLOGIN","","");
$resultRS=odbc_exec($odbcSASI,"SELECT * FROM AUSR WHERE
UCASE([USERID])='" . strtoupper(noquotes($_POST['id'])) . "'") or
die(odbc_errormsg());
$tempArray=odbc_fetch_array($resultRS);

Expected result:
----------------
Successful Database connection

Actual result:
--------------
Warning: SQL error: [Microsoft][ODBC dBase Driver] '(unknown)' is not a
valid path. Make sure that the path name is spelled correctly and that
you are connected to the server on which the file resides., SQL state
S1009 in SQLConnect in C:\DEMO\wwwroot\login.php on line 13

Warning: odbc_exec(): supplied argument is not a valid ODBC-Link
resource in C:\DEMO\wwwroot\login.php on line 15
[Microsoft][ODBC dBase Driver] '(unknown)' is not a valid path. Make
sure that the path name is spelled correctly and that you are connected
to the server on which the file resides.


------------------------------------------------------------------------


--
Edit this bug report at [url]http://bugs.php.net/?id=25958&edit=1[/url]