Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ADO/OLE to Connect To Non-Local Datasource
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01456946
Message ID:
01456952
Views:
55
>Not sure if this if the right Forum/Category, but here goes...
>
>I am using PHP to access a table in a foxpro database using the following code:
>
>
><?php
>$conn = new COM("ADODB.Connection");
>$conn->Open('Provider=VFPOLEDB.1;Data Source=c:\saturn\data\saturn.dbc;Collating Sequence=MACHINE');
>// SQL statement to build recordset.
>$lc_sql="SELECT * FROM CLMAST where cl_company=[B] order by cl_name";
>$rs = $conn->Execute($lc_sql);
>echo "<p>List of Saturn Customers:</p><hr>";
>// Display all the values in the records set
>while (!$rs->EOF) { 
>    $fv = $rs->Fields("cl_name","cl_code");
>    echo $fv->value."<br>\n";
>    $rs->MoveNext();
>} 
>$rs->Close(); 
>?>
>
>
>This works perfectly, the problem occurs when I try to access the live database which resides on a different server, i.e.:
>
>
>$conn->Open('Provider=VFPOLEDB.1;Data Source=\\SDMS-FINANCE\data\softwaresaturn\data\saturn.dbc;Collating Sequence=MACHINE');
>
>
>When I try this, I get the following error message:
>
>
>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:\Inetpub\wwwroot\tssapi\connect.php:3 Stack trace: #0 C:\Inetpub\wwwroot\tssapi\connect.php(3): com->Open('Provider=VFPOLE...') #1 {main} thrown in C:\Inetpub\wwwroot\tssapi\connect.php on line 3
>
>
>Any help would be greatly appreciated!

Doesn't sound like a VFP problem per se. If you're sure the path *is* correct then are you sure that the identity running the PHP code has the required permissions to access it ?
Previous
Reply
Map
View

Click here to load this message in the networking platform