RE: [PHP-DB] file dsn's or direct specification

From: Date: Fri, 07 Jul 2000 21:44:12 +0000
Subject: RE: [PHP-DB] file dsn's or direct specification
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-964@lists.php.net to get a copy of this message
Hi Avrum, I've not been able to get it to work. The driver manager will understand fairly 'raw' parameters being passed in, so I tried something like this: $dsn="DSN={Driver=/dbs/openlink/v32/lib/oplodbc.so.1;ServerType=SQLServer 7;HOST=ahill;Data base=northwind}"; or $dsn="Connectstring={Driver=/dbs/openlink/v32/lib/oplodbc.so.1;ServerType=SQ LServer 7;HOST=ahill;Data base=northwind}"; etc., in the hopes that the {} would prevent the contents from getting parsed by odbc_connect, but the page doesn't load, and I get errors. "The server returned and invalid or unrecognized response". Can any of you development types comment on if it's possible to force odbc_connect to perform a passthrough on what it receives in the dsn parameter? Best regards, Andrew ---------------------------------------------------- Andrew Hill Professional Services Consultant OpenLink Software http://www.openlinksw.com Universal Database Connectivity Technology Providers -----Original Message----- From: Andrew Hill [mailto:ahill@openlinksw.com] Sent: Friday, July 07, 2000 5:00 PM To: Avrum Goodblatt Subject: RE: [PHP-DB] file dsn's or direct specification Hi Avrum, I've not tested odbc_connect with the dsn-less connect string. I'll work on it and get back to you. BTW, odbc_exec and odbc_do are not optimal ways to execute statements. Using a combo of odbc_prepare and odbc_execute with a bound query parameter passed in to the prepared statement each time you want data uses many fewer db resources and will provide better performance. Best regards, Andrew -----Original Message----- From: Avrum Goodblatt [mailto:goodblat@sprynet.com] Sent: Friday, July 07, 2000 4:44 PM To: ahill@openlinksw.com Subject: RE: [PHP-DB] file dsn's or direct specification Thanks for the information. I was aware of how to do dsn-less connections, but was told that PHP's odbc_exec would NOT honor them. I am having a problem with getting it to work with php, and don't know whether it is php or something else causing the problem. Have you used such things successfully with PHP? On 7 Jul 2000, at 10:27, Andrew Hill wrote: > Hi Avrum, > > ODBC itself supports 'DSN-less' connects, e.g. you could use something like > this in your connect string: > > Driver={OpenLink Generic 32 Bit Driver};HOST=localhost;ServerType=SQLServer > 7;Database=pubs;UID=sa;PWD= > > Hope this helps! > > Best regards, > Andrew > ---------------------------------------------------- > Andrew Hill > Professional Services Consultant > OpenLink Software > http://www.openlinksw.com > Universal Database Connectivity Technology Providers > > -----Original Message----- > From: Avrum Goodblatt [mailto:goodblat@sprynet.com] > Sent: Thursday, July 06, 2000 5:06 PM > To: php-db@lists.php.net > Subject: [PHP-DB] file dsn's or direct specification > > > I've looked through the archives and cannot find a definitive answer to the > following questions: > > 1. is it possible to use file dsn's for odbc with php? > 2. is it possible to directly specify, instead of using a dsn > i.e. odbc_connect(odbc;driver= ... > Some comments seem to imply that neither can be done. > Does anyone know for sure? > > -------------------------------------------------- > Avrum Goodblatt goodblat@sprynet.com (415) 9451368 > http://home.sprynet.com/~goodblat > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -------------------------------------------------- Avrum Goodblatt goodblat@sprynet.com (415) 9451368 http://home.sprynet.com/~goodblat

« previous php.db (#964) next »