Solved

window php adodb connect to remote foxpro db folder

Posted on 2014-01-24
3
1,385 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 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