Re: [PHP] PHP + ODBC
On Dec 16, 2009, at 9:22 AM, Andrew Ballard wrote: > On Tue, Dec 15, 2009 at 10:13 AM, Philip Thompson > wrote: >> On Dec 14, 2009, at 8:47 PM, James McLean wrote: >>> Why not just use the built in MySQL libraries or PDO? >> >> Oh, that would be "my" preference. However, the database that I >> really need to connect to is an MSSQL one and the allowed connection >> type is ODBC. > > Is there any chance that you have to work with fields that will return > more than 4k of text? If so, you may have problems with ODBC. I can't > remember if I ever used odbc_connect() and its related functions with > SQL Server (I mostly use it to read Excel spreadsheets), but I know we > couldn't use PDO (with either the PDO_MSSQL or PDO_ODBC drivers) > because of a limit on TEXTSIZE that we couldn't get around. On our > older stuff, we're still using the mssql library, but on our newer > stuff we're using the SQL Server Driver for PHP. It connects via ODBC, > but it is the best library I've found for working with SQL Server in > PHP. > > > Andrew So, instead of using odbc_* functions, just use the mssql_* functions? ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + ODBC
On Tue, Dec 15, 2009 at 10:13 AM, Philip Thompson wrote: > On Dec 14, 2009, at 8:47 PM, James McLean wrote: >> Why not just use the built in MySQL libraries or PDO? > > Oh, that would be "my" preference. However, the database that I > really need to connect to is an MSSQL one and the allowed connection > type is ODBC. Is there any chance that you have to work with fields that will return more than 4k of text? If so, you may have problems with ODBC. I can't remember if I ever used odbc_connect() and its related functions with SQL Server (I mostly use it to read Excel spreadsheets), but I know we couldn't use PDO (with either the PDO_MSSQL or PDO_ODBC drivers) because of a limit on TEXTSIZE that we couldn't get around. On our older stuff, we're still using the mssql library, but on our newer stuff we're using the SQL Server Driver for PHP. It connects via ODBC, but it is the best library I've found for working with SQL Server in PHP. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + ODBC
On Dec 15, 2009, at 9:50 AM, Richard Quadling wrote: > 2009/12/15 Philip Thompson : >> On Dec 14, 2009, at 8:47 PM, James McLean wrote: >> >>> On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson >>> wrote: My head hurts from hitting it on my desk all day, so I thought I'd turn to a fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I can get it to work using isql from the command line. Can you verify my settings: >>> [snipped] I've tried the above DSNs and many other versions of it ad nauseum. The specific error I'm getting is... "[unixODBC][Driver Manager]Data source name not found, and no default driver specified." I really have searched high and low for a solution, but to no avail. Any thoughts? >>> >>> Why not just use the built in MySQL libraries or PDO? >> >> Oh, that would be "my" preference. However, the database that I really need >> to connect to is an MSSQL one and the allowed connection type is ODBC. I was >> just testing first with a MySQL connection to get it working (I don't have >> the MSSQL credentials yet). Turned out I was VERY close with my solution, >> which a coworker figured out this morning. The [ODBC Data Sources] entry for >> MySQL needed to specified correctly in /etc/odbc.ini. >> >> [ODBC Data Sources] >> MySQL = MySQL >> >> [MySQL] >> Description... >> Driver... >> >> I could have sworn I tried that, but who knows >> >> Thank you! >> ~Philip >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > You can use a DNS-string too ... > > odbc_pconnect("Driver={SQL Server Native Client > 10.0};Server={$s_Server};Database={$s_DB};MARS_Connection=Yes;", > $s_User, $s_Pswd, SQL_CUR_USE_DRIVER); I'm actually using a combination of the DSN*-string and the odbc.ini settings. Thank you! ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + ODBC
2009/12/15 Philip Thompson : > On Dec 14, 2009, at 8:47 PM, James McLean wrote: > >> On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson >> wrote: >>> My head hurts from hitting it on my desk all day, so I thought I'd turn to >>> a fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. >>> I can get it to work using isql from the command line. Can you verify my >>> settings: >>> >> [snipped] >>> >>> I've tried the above DSNs and many other versions of it ad nauseum. The >>> specific error I'm getting is... "[unixODBC][Driver Manager]Data source >>> name not found, and no default driver specified." I really have searched >>> high and low for a solution, but to no avail. Any thoughts? >> >> Why not just use the built in MySQL libraries or PDO? > > Oh, that would be "my" preference. However, the database that I really need > to connect to is an MSSQL one and the allowed connection type is ODBC. I was > just testing first with a MySQL connection to get it working (I don't have > the MSSQL credentials yet). Turned out I was VERY close with my solution, > which a coworker figured out this morning. The [ODBC Data Sources] entry for > MySQL needed to specified correctly in /etc/odbc.ini. > > [ODBC Data Sources] > MySQL = MySQL > > [MySQL] > Description... > Driver... > > I could have sworn I tried that, but who knows > > Thank you! > ~Philip > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You can use a DNS-string too ... odbc_pconnect("Driver={SQL Server Native Client 10.0};Server={$s_Server};Database={$s_DB};MARS_Connection=Yes;", $s_User, $s_Pswd, SQL_CUR_USE_DRIVER); -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + ODBC
On Dec 14, 2009, at 8:47 PM, James McLean wrote: > On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson > wrote: >> My head hurts from hitting it on my desk all day, so I thought I'd turn to a >> fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I >> can get it to work using isql from the command line. Can you verify my >> settings: >> > [snipped] >> >> I've tried the above DSNs and many other versions of it ad nauseum. The >> specific error I'm getting is... "[unixODBC][Driver Manager]Data source name >> not found, and no default driver specified." I really have searched high and >> low for a solution, but to no avail. Any thoughts? > > Why not just use the built in MySQL libraries or PDO? Oh, that would be "my" preference. However, the database that I really need to connect to is an MSSQL one and the allowed connection type is ODBC. I was just testing first with a MySQL connection to get it working (I don't have the MSSQL credentials yet). Turned out I was VERY close with my solution, which a coworker figured out this morning. The [ODBC Data Sources] entry for MySQL needed to specified correctly in /etc/odbc.ini. [ODBC Data Sources] MySQL = MySQL [MySQL] Description... Driver... I could have sworn I tried that, but who knows Thank you! ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + ODBC
On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson wrote: > My head hurts from hitting it on my desk all day, so I thought I'd turn to a > fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I > can get it to work using isql from the command line. Can you verify my > settings: > [snipped] > > I've tried the above DSNs and many other versions of it ad nauseum. The > specific error I'm getting is... "[unixODBC][Driver Manager]Data source name > not found, and no default driver specified." I really have searched high and > low for a solution, but to no avail. Any thoughts? Why not just use the built in MySQL libraries or PDO? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + ODBC
Hello all. My head hurts from hitting it on my desk all day, so I thought I'd turn to a fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I can get it to work using isql from the command line. Can you verify my settings: /etc/odbc.ini: [MySQL] Description = MySQL 3.51 ODBC driver Driver = MySQL Host= s-irv-web02 Server = s-irv-web02 UID = user Password= pass Database= clients Port= 3306 /etc/odbcinst.ini: [MySQL] Description = ODBC 3.51 for MySQL Driver = /usr/lib/libmyodbc3.so Setup = /usr/lib/libodbcmyS.so FileUsage = 1 UsageCount = 2 Again, isql allows me to connect with the same settings as above: isql MySQL user pass I've tried several settings in PHP to attempt to connect to it. All have been fruitless: I've tried the above DSNs and many other versions of it ad nauseum. The specific error I'm getting is... "[unixODBC][Driver Manager]Data source name not found, and no default driver specified." I really have searched high and low for a solution, but to no avail. Any thoughts? Thanks in advance, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, ODBC and Pervasive SQL
I am trying to connect from PHP to Pervasive SQL using ODBC, and I am experiencing difficulty. My PHP looks like this: $dsn = "GruffTrading"; // Datasource $dsu = ""; // User $dsp = ""; // Password if(!$odbc = odbc_connect($dsn,$dsu,$dsp)) die("Unable to connect to Data Source $dsn".odbc_error().": ".odbc_errormsg()); I can connect to the database using the same DSN from MS Access, and I can connect to an Access database using the same PHP code, but obviously a different DSN. The error is S1000: [Pervasive Software][ODBC Interface][Pervasive Software SQL Engine]General error. I am using the Pervasive Software ODBC-32 driver, version 2.04.02.10, and am running on Windows 2000 Professional, latest patches and stuff all loaded, and PHP 4.3.0 I would appreciate any pointers in the right direction. Cheers, William.
[PHP] PHP ODBC and Pervasive.SQL
Hi, I am executing a SELECT query from PHP (4.3.4) through ODBC on a Pervasive 2000SP4 (all on Windows). odbc_result_all, odbc_fetch_into, and all other php odbc function stop returning records before the end of the effective resultset. Here is what is happening : * In Pervasive: SELECT * FROM table returns n records (correct). * In Access, throught ODBC, the same query returns the same n records (correct). * In PHP, odbc_exec of the same query returns mhttp://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP ODBC
Is there ODBC for PHP4 for LINUX to connect MS-SQL? p.s. other than openlink software rgds ./pl
[PHP] PHP ODBC Problem
Hi, I've installed PHP 4.3.0 on a Win2k (SP3) IIS 5 server, as we were moving the site to another server (old server was also win2k, php 4.3.0), and ODBC calls no longer function correctly when served from the webserver, however they work perfectly when called from the command line. So http://site/odbc_test.php hanged, while 'php odbc_test.php' in cmd.exe worked perfectly. The ODBC drivers and settings are the same as what was on the previous server. Tracked down the problem to the ODBC_Connect line. If I specified an invalid DSN, e.g. odbc_connect("wrong", "","") or die (); the script would terminate with the correct error message. However, if I specified a valid DSN then PHP would simply hang. No error message. Nothing in the Event Viewier. At first I was using the ISAPI version of PHP for IIS, but then after I saw ODBC work using PHP from the command line, I changed IIS over to use php.exe, but with no success. Any ideas? Oh, and I did end up setting the security permissions for the ODBC database directory to give System & Everyone & IUSER_ full access. Mike C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP + ODBC on IIS (Win2k)
Ignacio, He can use Access and local ODBC just fine, as he is on a Windows box. Actually, the ODBC Socket server isn't needed from Linux either, as OpenLink provides Single-Tier and Multi-Tier ODBC drivers from *nix platforms to many databases. Best regards, Andrew Hill Director of Technology Evangelism http://www.openlinksw.com/virtuoso/whatis.htm OpenLink Virtuoso Internet Data Integration Server > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 26, 2002 10:35 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP] PHP + ODBC on IIS (Win2k) > > > PHP will not work on that way in order to retrieve data from Access using > ODBC. Check the URL: > > http://www.phpbuilder.com/columns/timuckun20001207.php3 > > See you !!! > > Atte. Ignacio Estrada F. > Centro Nacional de Control de Energia > Area de Control Occidental > 025+6463, 025+6464, 025+6469 > - Remitido por Ignacio Estrada Fonseca/CEN/GDL/CFE con fecha > 02/26/2002 > 09:34 - > > > "Andrew Hill" > > Timocea" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > nksw.com>cc: > > Asunto: RE: [PHP] > PHP + ODBC on IIS (Win2k) > 02/26/2002 > > 08:53 > > > > > > > > > Sebastian, > > Check your System DSN - "Options" button, and verify that you don't have > "Exclusive" checked off. > > Hope this helps. > > Best regards, > Andrew Hill > Director of Technology Evangelism > http://www.openlinksw.com/virtuoso/whatis.htm > OpenLink Virtuoso Internet Data Integration Server > > > -Original Message- > > From: Sebastian Timocea [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 26, 2002 9:47 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] PHP + ODBC on IIS (Win2k) > > > > > > Hello! > > > > I am having a really ugly problem here and I hope somebody can > > help me with > > this. > > I work on > > - Windows 2000 Advanced Server > > - PHP for Windows and IIS (it works ok) > > > > I have a DBTest.mdb database (Access 2000) and an ODBC > connection to this > > database: > > System DSN="DBTest", no user and password to connect! I have tested this > > ODBC connection with a VBasic simple application and it works just fine. > > > > Now I create a Test.php file with this content: > > > odbc_connect("DBTest", "", ""); > > ?> > > > > When I open this file in the browser > > http://localhost/directory/Test.php? I > > get the next error: > > "Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] > > The Microsoft > > Jet database engine cannot open the file '(unknown)'. It is already > opened > > exclusively by another user, or you need permission to view its data., > SQL > > state S1000 in SQLConnect in C:\inetpub\wwwroot\directory\Test.php on > line > > 3" > > > > I have checked everything and the database is not opened by anybody. > Plus, > > the Security rights are set to enable Everyone and Internet > Guest Account > > (IUSR_myserver) to have Full Control ont the database. > > > > So, could anybody help me with this PLEASE?? > > :`-( > > > > Thank you in advance, > > Sebastian. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP + ODBC on IIS (Win2k)
PHP will not work on that way in order to retrieve data from Access using ODBC. Check the URL: http://www.phpbuilder.com/columns/timuckun20001207.php3 See you !!! Atte. Ignacio Estrada F. Centro Nacional de Control de Energia Area de Control Occidental 025+6463, 025+6464, 025+6469 - Remitido por Ignacio Estrada Fonseca/CEN/GDL/CFE con fecha 02/26/2002 09:34 - "Andrew Hill" , <[EMAIL PROTECTED]> nksw.com>cc: Asunto: RE: [PHP] PHP + ODBC on IIS (Win2k) 02/26/2002 08:53 Sebastian, Check your System DSN - "Options" button, and verify that you don't have "Exclusive" checked off. Hope this helps. Best regards, Andrew Hill Director of Technology Evangelism http://www.openlinksw.com/virtuoso/whatis.htm OpenLink Virtuoso Internet Data Integration Server > -Original Message- > From: Sebastian Timocea [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 26, 2002 9:47 AM > To: [EMAIL PROTECTED] > Subject: [PHP] PHP + ODBC on IIS (Win2k) > > > Hello! > > I am having a really ugly problem here and I hope somebody can > help me with > this. > I work on > - Windows 2000 Advanced Server > - PHP for Windows and IIS (it works ok) > > I have a DBTest.mdb database (Access 2000) and an ODBC connection to this > database: > System DSN="DBTest", no user and password to connect! I have tested this > ODBC connection with a VBasic simple application and it works just fine. > > Now I create a Test.php file with this content: > odbc_connect("DBTest", "", ""); > ?> > > When I open this file in the browser > http://localhost/directory/Test.php? I > get the next error: > "Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] > The Microsoft > Jet database engine cannot open the file '(unknown)'. It is already opened > exclusively by another user, or you need permission to view its data., SQL > state S1000 in SQLConnect in C:\inetpub\wwwroot\directory\Test.php on line > 3" > > I have checked everything and the database is not opened by anybody. Plus, > the Security rights are set to enable Everyone and Internet Guest Account > (IUSR_myserver) to have Full Control ont the database. > > So, could anybody help me with this PLEASE?? > :`-( > > Thank you in advance, > Sebastian. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP + ODBC on IIS (Win2k)
Sebastian, Check your System DSN - "Options" button, and verify that you don't have "Exclusive" checked off. Hope this helps. Best regards, Andrew Hill Director of Technology Evangelism http://www.openlinksw.com/virtuoso/whatis.htm OpenLink Virtuoso Internet Data Integration Server > -Original Message- > From: Sebastian Timocea [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 26, 2002 9:47 AM > To: [EMAIL PROTECTED] > Subject: [PHP] PHP + ODBC on IIS (Win2k) > > > Hello! > > I am having a really ugly problem here and I hope somebody can > help me with > this. > I work on > - Windows 2000 Advanced Server > - PHP for Windows and IIS (it works ok) > > I have a DBTest.mdb database (Access 2000) and an ODBC connection to this > database: > System DSN="DBTest", no user and password to connect! I have tested this > ODBC connection with a VBasic simple application and it works just fine. > > Now I create a Test.php file with this content: > odbc_connect("DBTest", "", ""); > ?> > > When I open this file in the browser > http://localhost/directory/Test.php? I > get the next error: > "Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] > The Microsoft > Jet database engine cannot open the file '(unknown)'. It is already opened > exclusively by another user, or you need permission to view its data., SQL > state S1000 in SQLConnect in C:\inetpub\wwwroot\directory\Test.php on line > 3" > > I have checked everything and the database is not opened by anybody. Plus, > the Security rights are set to enable Everyone and Internet Guest Account > (IUSR_myserver) to have Full Control ont the database. > > So, could anybody help me with this PLEASE?? > :`-( > > Thank you in advance, > Sebastian. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + ODBC on IIS (Win2k)
Hello! I am having a really ugly problem here and I hope somebody can help me with this. I work on - Windows 2000 Advanced Server - PHP for Windows and IIS (it works ok) I have a DBTest.mdb database (Access 2000) and an ODBC connection to this database: System DSN="DBTest", no user and password to connect! I have tested this ODBC connection with a VBasic simple application and it works just fine. Now I create a Test.php file with this content: When I open this file in the browser http://localhost/directory/Test.php? I get the next error: "Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLConnect in C:\inetpub\wwwroot\directory\Test.php on line 3" I have checked everything and the database is not opened by anybody. Plus, the Security rights are set to enable Everyone and Internet Guest Account (IUSR_myserver) to have Full Control ont the database. So, could anybody help me with this PLEASE?? :`-( Thank you in advance, Sebastian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php