Solved

Problems with ODBC linking to data on another computer

Posted on 2003-10-28
3
778 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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