correct ODBC setup
| From: | r-rethmann at cocon-commerz dot de | Date: | Tue, 20 May 2003 15:46:48 +0000 |
| Subject: | correct ODBC setup | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5479@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to connect to a FoxPro-Database on my server.
After some trial and error I've discovered, that I can connect with this
simple DSN:
$dsn = "odbc://$db_name";
All other combinations I've tried gave errors.
But when I try to access the db with an SQL statement like 'SELECT * from
db' I get the error:
[Microsoft][ODBC Driver Manager]Der Datenquellenname wurde nicht gefunden,
und es wurde kein Standardtreiber angegeben.,SQL state IM002 in SQLConnect
When I test my connection with ODBCTEST it works, so I assume it's not a
connection setup error.
I couldn't find any valueable information from the PEAR docs about how to
format the DSN string for ODBC...
So I've tried to debug my little prog:
$db = DB::connect($dsn); -> this works out well
After connecting to the odbc driver I'll get a db object. The db->dsn[]
array looks like this:
database = false // this should be my db_name
dbsyntax = odbc
hostspec = db_name // wasn't set, maybe PEAR expects the hostname to be
sent and always prior the db_name
password = false
phptype = odbc
port = false
protocol = tcp
socket = false
username = false
The error shows up even when I manually correct these values during
runtime.
How knows what to do ?
Thanks for your help, Rado