Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

window php adodb connect to remote foxpro db folder

Posted on 2014-01-24
3
Medium Priority
?
1,530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

705 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