Bug #13312 Updated: cant connect to a odbc source

From: Date: Sat, 15 Sep 2001 18:19:55 +0000
Subject: Bug #13312 Updated: cant connect to a odbc source
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-66020@lists.php.net to get a copy of this message
ID: 13312 Updated by: ahill Reported By: parabips@hotmail.com Status: Open Bug Type: ODBC related Operating System: Windows2000 server PHP Version: 4.0.6 New Comment: This will occur on Windows if you try to use a File DSN instead of a System DSN - and is expected behavior. Try a System DSN. For people searching the bug list, if you experience this on linux/unix, this will occur if you don't pass the location of your odbc.ini to your script with a putenv("ODBCINI=/path/to/odbc.ini"); Best regards, Andrew Hill OpenLink Software Previous Comments: ------------------------------------------------------------------------ [2001-09-15 04:04:27] parabips@hotmail.com I tried to connect with a Microsoft Access database but it didnt work. I made the DSN named reg and then I used the following code to connect $connection=odbc_connect("reg","admin","") or die ("Cant connect the datasource"); $sql="Select * from newuser order by name asc"; $sql_statement=odbc_prepare($connection,$sql) or die ("Cant prepare statement"); $sql_result=odbc_execute($sql_statement) or die ("Cant execute query"); odbc_result_all($sql_result,"border=1"); odbc_free-result($sql_result); odbc_close($connection); when i view the php page it says Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified can anyone solve my problem ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13312&edit=1

« previous php.dev (#66020) next »