## ADOdb Frequently Asked Questions

Home Download

GENERAL

1. What is ADOdb?
   An object oriented library written in PHP that abstracts database operations for portability. It is modelled on Microsoft's ADO, but has many improvements that make it unique (eg. pivot tables, Active Record support, generating HTML for paging recordsets with next and previous links, cached recordsets, HTML menu generation, etc).

2. Can I use ADOdb for commercial applications for free?
   Yes; ADOdb uses a BSD-style license so you can freely use the source code in any application, so long as you comply to the terms of license.txt.

3. How can I learn ADOdb?
   See the docs. There is an extensive list of tutorials listed.

4. How can I contribute to ADOdb?
   - You can translate documentation to another language.
   - Link to this web-site.
   - Port ADOdb to new databases.
   - Make me very happy by buying a copy of phpLens.
   Code contributions are also welcome provided they enhance functionality, preferably work on multiple databases, and are backward compatible.

5. Who is using ADOdb?
   Many PHP applications and web-sites. There is partial list here: http://php.weblogs.com/adodb-cool-applications

6. Is there a mailing list or forum to discuss ADOdb?
   There is a forum at http://phplens.com/lens/lensforum/topics.php?id=4. There is no longer any mailing list due to spammers.

TECHNICAL

1. # Why do I get a ociplogon/ocilogon undefined error message?
   Why do I get a mysql_pconnect/mysql_connect undefined error message?
   Why do I get a ibase_timefmt undefined error message?
   Why do I get a *_connect/*_pconnect undefined error message?
   You do not have this extension compiled or included with PHP. On Windows, you can include it by modifying your php.ini (extension=extension_name.dll). On Unix, you will need to compile the extension - for help try this knowledgebase. Or perhaps you do not have the database client installed.

2. # I am trying to create two connections to the same database, but the 2nd connection doesn't work, but reuses the first connection.

   This is a "feature" of PHP. When you make a 2nd connection that only differs by the database name, you get back the first connection. This is normally the reason for the problem described.

   From http://php.net/manual/en/function.mysql-connect.php (this applies to other db's too):

   If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.

   Possible solutions include:

   - Use different userid and password for each connection.
   - Use different IP or host-address for each connection, even when connecting to same server! Eg. use 'localhost' and '127.0.0.l'.
   - Use NConnect( ), which always forces a new connection, if the database driver supports it (Oci8, MySQL,MSSQL and PostgreSQL).
   - Use SelectDB( ), which switches databases, if the database driver supports it (MySQL, MSSQL, Sybase).

3. Can you tell me what is wrong with this code snipplet? - it does not do anything...[code deleted]...
   Try turning on debugging. Eg.

         $DB = ADONewConnection($driver);
         $DB->debug = 1;

   This will show all error messages and generated SQL.

4. SelectLimit with Oracle oci8 is not working.
   The adodb_pager class is not working with oci8.
   You are probably using a version of Oracle earlier than 8.1.7, or have compatibility set to an earlier version in init.ora. You can try using the oci805 driver instead.

5. Why does mssql only retrieve the first 255 or 4096 bytes of my data?
   See http://phplens.com/lens/lensforum/msgs.php?id=3564

6. # I tried in Microsoft Access to insert a record but i cannot see it, or it is inserted twice. Why?
   The Access ODBC driver is not thread-safe.

   When you run Microsoft Jet in an IIS environment, it is recommended that you use the native Jet OLE DB Provider in place of the Microsoft Access ODBC driver. The Microsoft Access ODBC driver (Jet ODBC driver) can have stability issues due to the version of Visual Basic for Applications that is invoked because the version is not thread safe.

   An example of using the thread-safe OLE DB provider:

       $dsn = 'Provider=Microsoft.Jet.OLEDB.4.0;'.
                    'Data Source=C:\path\to\MyDatabase.mdb;';
       $db = NewADOConnection('ado_access');
       $db->PConnect($dsn);

   There have been reports that using PConnect() is more reliable than Connect() with Access. I have also heard of good experiences using ODBTP; you can call it directly, or through the ADOdb odbtp driver.

7. # I cannot connect to Access/VFP/SQL Server from IIS. However I can connect from the desktop.
   This is probably a Windows 2000 file permissions problem. IIS assumes a specific userid when serving web pages, and it is likely that userid does not have permission to access the database. You need to change the IIS user to someone who has permission the database.

8. Oracle problem with ADOdb?

   If it is a very technical question, you can try this forum http://forums.oracle.com/forums/forum.jsp?forum=178

(c) 2000-2004 John Lim. All rights reserved.