Solved

window php adodb connect to remote foxpro db folder

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
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…
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…

615 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