Solved

Problems with ODBC linking to data on another computer

Posted on 2003-10-28
3
806 Views
Last Modified: 2013-12-19
I am using PHP and having a problem with ODBC. Not sure if the problem is with PHP or with ODBC but my feeling is ODBC. Is it possible to create an ODBC connection on one computer and point it to data on another computer and it work?

The error I recieve in PHP is: "[Microsoft][ODBC dBase Driver] '(unknown)'"

Long Summary below:


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
 
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.
 
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);
 
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.
 
 
Configuration - 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
0
Comment
Question by:Alder
3 Comments
 
LVL 2

Accepted Solution

by:
rccguy earned 125 total points
ID: 9688946
My suggestion is for you to check out a product called Code Charge, it handles all types of programming lanquages.  You can download a trial version at http://www.codecharge.com/index2.php.  This product is really good at dealing with database connectivity.  It also writes in several different lanquages.  Try it out and see if it can connect to your database.  You will have to set up the ODBC yourself, but there a lot of tools in the software that can help you figure it out.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question