error connect remote foxpro DB thru ODBC

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

error connect remote foxpro DB thru ODBC

Post by valen53 »

is OK to connect foxpro DB thru ODBC in local pc.
but when i connect remote foxpro DB thru ODBC, it occur error.

Warning: SQL error: [Microsoft][ODBC Visual FoxPro Driver]Server, SQL state 01S00 in SQLConnect in C:\Apache Group\Apache...

i search this warning quite many time already, but still can't get the answer.

anybody know how to solve it?

Code: Select all

<?php
$dsn = "Driver={Microsoft Visual FoxProDriver}; Server=bca_server; Database=dw" ;
$pr=odbc_pconnect($dsn,"root",""); 
?>
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Take a look a this

RIGHT HERE
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

thanks reply.

Code: Select all

<?php
$dsn = "Driver={Microsoft Visual FoxPro Driver}; Server=localhost;SourceType=DBC;SourceDB=D:\installer\data_DEMO\myapp.dbc;Exclusive=No;";
$pr=odbc_pconnect($dsn,"root","");
?>
it is another way i used, it work for localhost only. if i change to other pc, like below , warning occur .

Code: Select all

<?php
$dsn = "Driver={Microsoft Visual FoxPro Driver}; Server=192.168.0.5;SourceType=DBC;SourceDB=D:\installer\data_DEMO\myapp.dbc;Exclusive=No;";
?>
Warning: SQL error: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file c:/data_demo/myapp.dbc.


THE URL u show, i saw already.. then i follow to do it.

Code: Select all

<?php
$database_type = "vfp" ;
$host = "localhost" ;
$user = "root" ;
$password = "" ;
$dbname = "myapp" ;

include("adodb/adodb.inc.php");
$pr = NewADOConnection("$database_type");
$db->Connect("$host","$user","$password","$dbname");
?>
error again.
Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\Apache

any resource can provide ?
Post Reply