Solved

window php adodb connect to remote foxpro db folder

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

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). #…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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