wagz
11-23-2006, 03:08 AM
Hi,
My work have given me the job of making their website connect to their accounts server which uses a foxpro free table database. Both the webserver(windows) and accounts server are on the same network, I just cant seem to get it to work, what ive done is...
Created an ODBC connection on the webserver, connecting to accounts server.
Put this code in a file on the webserver.
<?php
//connect to database
$connectionstring = odbc_connect("Vision.dsn", "", "");
//SQL quyery
$Query = "SELECT * FROM CUSTOMER";
//execute query
$queryexe = odbc_do($connectionstring, $Query);
//output results to standard output
odbc_result_all($queryexe, "BORDER=1");
//diconnect from database
odbc_close($connectionstring);
?>
And when running that script i get the error
Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Visual FoxPro Driver]File 'customer.dbf' does not exist., SQL state S0002 in SQLExecDirect in E:\CBTechWeb\vision\dbconnect.php on line 10
Warning: odbc_result_all(): supplied argument is not a valid ODBC result resource in E:\CBTechWeb\vision\dbconnect.php on line 13
Any help on how to get this working would be great.
Cheers.
Mark
My work have given me the job of making their website connect to their accounts server which uses a foxpro free table database. Both the webserver(windows) and accounts server are on the same network, I just cant seem to get it to work, what ive done is...
Created an ODBC connection on the webserver, connecting to accounts server.
Put this code in a file on the webserver.
<?php
//connect to database
$connectionstring = odbc_connect("Vision.dsn", "", "");
//SQL quyery
$Query = "SELECT * FROM CUSTOMER";
//execute query
$queryexe = odbc_do($connectionstring, $Query);
//output results to standard output
odbc_result_all($queryexe, "BORDER=1");
//diconnect from database
odbc_close($connectionstring);
?>
And when running that script i get the error
Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Visual FoxPro Driver]File 'customer.dbf' does not exist., SQL state S0002 in SQLExecDirect in E:\CBTechWeb\vision\dbconnect.php on line 10
Warning: odbc_result_all(): supplied argument is not a valid ODBC result resource in E:\CBTechWeb\vision\dbconnect.php on line 13
Any help on how to get this working would be great.
Cheers.
Mark