Solved

window php adodb connect to remote foxpro db folder

Posted on 2014-01-24
3
1,335 Views
Last Modified: 2014-01-30
SYSTTEM : APACHE WEB SERVER, PHP 5.3++, POSTGRES
OS          : WINDOW 8 HOME PREMIUM
DRIVER  : Visual FoxPro ODBC Drivers 6.01.8629.01
NETWORK : Peer to peer under workgroup


I am able to connect to local deskop foxpro db file:  

$source_db="C:\mysite\data\\temp\\s2000_data\\vfsss.dbc" and it is successful.

But when I try to connect to remote computer : K46C (ip address:192.168.3.119)

require('adodb5/adodb-exceptions.inc.php');
require ('adodb5/adodb.inc.php');      

$source_db="\\\\K46C\mysite\s2000_data\\vfsss.dbc";
$dsn= "Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=$source_db;Exclusive=No;";
                        
            $db_vfp = NewADOConnection("vfp");
            $db_vfp->debug = true;
            $db_vfp->Connect($dsn);

Warning: odbc_connect(): SQL error: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file \\k46c\mysite\s2000_data\vfsss.dbc., SQL state S1000 in SQLConnect in C:\mysite\common\adodb5\drivers\adodb-odbc.inc.php on line 63

I try to map network drive for the path and change it to

$source_db="U:\s2000_data\\vfsss.dbc";

Warning: odbc_connect(): SQL error: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file
u:\s2000_data\vfsss.dbc., SQL state S1000 in SQLConnect in C:\mysite\common\adodb5\drivers\adodb-odbc.inc.php
on line 63

How should I connect to remote desktop to pull out foxpro data.  Is it something to do with access right in remote folder or php adodb library  do not have function to connect remote computer.
0
Comment
Question by:thkoo
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 39808274
DBF has no server, access rights to DBF files merely are file system access rights.

In the moment you want to access files in a network share, it won't matter if you do so by a mapped drive letter or UNC path, what matters is, that web servers run on service accounts not having network access privileges, eg apache runs as LOCAL SYSTEM account, which only can access all LOCAL files. You need to configure your apache right, to use a domain account having access to the \\K46C share. You might also first need to make your dbf folder a share. Even if you setup the dbf folder for access to the windows account EVERYONE, that just means any local account will have access, no network access is allowed this way. In short Windows file system privileges are not as simple as on Linux.

Another thing: In the end the PHP interpreter accesses DBF files. Find out what system account apache runs on and how it starts PHP and what account runs that.

Bye, Olaf.
0
 

Accepted Solution

by:
thkoo earned 0 total points
ID: 39808843
thank olaf

i have in fact found solution 1hr ago based on principal you mention above.

The only thing i can't is to use mapped network drive.  Instead i have to use UNC path
to pull out data from remote share folder.

But it doesn't matter any more.  

thank any way for your advice
0
 

Author Closing Comment

by:thkoo
ID: 39820327
his point is correct
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now