PHP - can't connect to db over network

Associate
Joined
18 Oct 2002
Posts
2,055
Location
Southend-on-Sea
I've been developing some reports for a client who uses a FoxPro database. For development, I've been using the files locally on my hard drive but I'm now ready to test against live data. However, I'm unable to connect to the db over the network.

The connection string for my local files is:

Code:
$conn->Open('Provider=VFPOLEDB.1;Data Source="D:\\db\Comp_B.DBC";');

I've mapped the location of the db on the network to my O drive and have tried the following formats, but I keep getting an 'Invalid path or file name' error:

Code:
$conn->Open('Provider=VFPOLEDB.1;Data Source="O:\\operav5\Data\CompB\Comp_B.DBC";');
$conn->Open('Provider=VFPOLEDB.1;Data Source="\\sbs01\operav5\Data\CompB\Comp_B.DBC";');
$conn->Open('Provider=VFPOLEDB.1;Data Source="O:\operav5\Data\CompB\Comp_B.DBC";');

(sbs01 is the server name)

None of these work, although they are all valid paths as far as Windows is concerned. I've posted on a couple of Foxpro forums but no response so far, so was just wondering if anyone here can offer any suggestions.

Thanks
 
Last edited:
Thanks for the response.

The ODBC connection works fine from my PC, these reports are replacing Excel spreadsheets that connect to the same data source via ODBC without issue.

The error thrown out in the php error log is:

[16-Sep-2011 14:16:42] PHP Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for Visual FoxPro<br/><b>Description:</b> Invalid path or file name.' in C:\xampp\htdocs\reports\scripts\get_all_open_tickets.php:4
Stack trace:
#0 C:\xampp\htdocs\reports\scripts\get_all_open_tickets.php(4): com->Open('Provider=VFPOLE...')
#1 {main}
thrown in C:\xampp\htdocs\reports\scripts\get_all_open_tickets.php on line 4


edit - for some reason when I copy the error log here its adding a space in the word 'tickets', not sure why, the error log does not contain this space.
 
Last edited:
Back
Top Bottom