This HTML5 document contains 34 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
n25http://www.iodbc.org/dataspace/services/wiki/
dctermshttp://purl.org/dc/terms/
n22http://www.iodbc.org:80/wiki/main/iodbcWiki/FAQ/iodbcadm-gtk-filedsn.
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n27http://virtuoso.openlinksw.com/
oplhttp://www.openlinksw.com/schema/attribution#
n4http://www.iodbc.org/dataspace/person/iodbc#
n12http://www.iodbc.org/dataspace/iodbc#
n23http://www.openlinksw.com/
n2http://www.iodbc.org/dataspace/iodbc/wiki/iodbcWiki/
dchttp://purl.org/dc/elements/1.1/
rdfshttp://www.w3.org/2000/01/rdf-schema#
n26http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/
n24http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n20https://web.archive.org/web/20010302094845/http://195.153.164.12:80/wwwboard/wwwboard.
n6http://www.iodbc.org/dataspace/iodbc/wiki/
n15http://www.iodbc.org/dataspace/%28NULL%29/wiki/iodbcWiki/
n13http://www.opensource.org/licenses/lgpl-license.
n17http://www.iodbc.org/dataspace/iodbc/wiki/iodbcWiki/FAQ/sioc.
n9http://www.opensource.org/licenses/bsd-license.
n18http://uda.openlinksw.com/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
xsdhhttp://www.w3.org/2001/XMLSchema#
n10http://www.iodbc.org/dataspace/dav#
siochttp://rdfs.org/sioc/ns#
n7http://www.iodbc.org/dataspace/person/dav#
Subject Item
n2:FAQ
rdf:type
sioct:Comment atom:Entry
dcterms:created
2016-09-14T12:28:34.134984
dcterms:modified
2018-11-19T15:17:32.776095
rdfs:label
FAQ
foaf:maker
n4:this n7:this
n24:has_services
n25:item
dc:title
FAQ
sioc:link
n2:FAQ
sioc:id
7c359733d029b0f601c914309377ae50
opl:isDescribedUsing
n17:rdf
sioc:links_to
n9:php n13:php n15:TraceFile n18: n15:SourceForge n2:About n20:html n23: n26:IODBCPHPHOWTO n2:License n27:
sioc:has_creator
n10:this n12:this
sioc:has_container
n6:iodbcWiki
atom:source
n6:iodbcWiki
atom:title
FAQ
atom:author
n7:this
atom:published
2016-09-14T12:28:34Z
atom:updated
2018-11-19T15:17:32Z
sioc:content
---+ iODBC FAQ %TOC% This document is a list of Frequently Asked Questions concerning the iODBC project. It is currently maintained by <code>iodbc&#64;openlinksw.com</code>; please feel free to send nominations for FAQ-worthy topics to this address. ---++ About iODBC.org ---+++ What does iODBC stand for? iODBC is an acronym for "Independent Open Database Connectivity". See [[About][About iODBC]] for more. ---+++ Under what license is iODBC available? iODBC is dual-licensed under both the [[http://www.opensource.org/licenses/bsd-license.php][BSD]] and [[http://www.opensource.org/licenses/lgpl-license.php][LGPL]] licenses. Please see the [[License][License Page]] for more details. ---+++How do I get support for iODBC Support for iODBC is available through <a href="https://sourceforge.net/p/iodbc/mailman/">several mailing-lists hosted by SourceForge.net</a>, where the wider community (and <nop>OpenLink employees) contribute to the best of their ability. The previous forum has been archived but may contain useful reference material. Commercial support may also be contracted from <nop>OpenLink Software. ---+++What is the relationship between <nop>OpenLink Software and iODBC? [[http://www.openlinksw.com/][OpenLink Software]] is a software company specializing in data access, management, and integration technologies including ODBC, JDBC, ADO.NET, OLE DB, XMLA, SQL, SPARQL, and others. Products include [[http://uda.openlinksw.com/][UDA, a suite of data access drivers/providers/connectors]] and [[http://virtuoso.openlinksw.com/][Virtuoso Universal Server]] a multi-model RDBMS. iODBC is an open-source project (released under the LGPL or BSD licenses) hosted by <nop>OpenLink Software for the benefit of the wider community, to implement and improve a free and Open ODBC Driver Manager component for Linux, macOS, Unix-like, VMS, and other platforms. iODBC copyright is co-owned by Ke Jin and <nop>OpenLink Software. <nop>OpenLink are the sole project custodian and sponsor. <b>Advertising:</b> <nop>OpenLink may benefit from the publicity of hosting iODBC.org, with its links to various vendors of ODBC drivers for assorted platforms and RDBMS, but we don't set out to abuse the open-source project for commercial gain. There are plenty of free and open-source database drivers for free databases (<nop>MySQL, <nop>PostgreSQL, Firebird, and others). The <nop>OpenLink philosophy is to facilitate OS- and database-independent connectivity through ODBC, to which end having an open-source driver-manager component is advantageous. <b>Resources:</b> Various <nop>OpenLink employees work on actively developing and maintaining the authoritative CVS sources of the iODBC project, administering the server on which the site runs, maintaining the www.iodbc.org website, responding to posts on the public forums, etc. <b>Executive summary:</b> Think <i>nice <code>.com</code> hosts free <code>.org</code></i> and you'll not be far from the truth. ---+++What happened to the Forum Archive (wwwboard)? After a long innings, wwwboard proved too susceptible to spam and other undesirable phenomena, and the underlying wwwboard implementation was unpleasant to maintain, becoming corrupt with increasing frequency. As such, it has been replaced with the mailing-lists, hosted by SourceForge. In the process, the old wwwboard has been left in stasis; a small cleanup operation was mounted to remove off-topic and dubious / offensive / illegal material and links, but not extending as far as censorship: if someone said iODBC or <nop>OpenLink suck, you'll see it represented as-stated there. Since then, the wwwboard service has succumbed to bitrot. Old postings may be reviewed via [[https://web.archive.org/web/20010302094845/http://195.153.164.12:80/wwwboard/wwwboard.html][archive.org]]. ---++Technical ---+++What's an odbc.ini and what do I put in it? An <code>odbc.ini</code> is the main configuration file in which all your DSNs and much of the ODBC configuration parameters are stored. iODBC has a search-path for finding such a configuration file: first, the environment variable <code>ODBCINI</code> is inspected to see if it points at a suitable file, or <code>~/.odbc.ini</code> (analagous to User DSNs on Windows) then <code>/etc/odbc.ini</code> ("system-wide") are fall-back locations. The <code>odbc.ini</code> file comprises 3 parts: a set of ODBC options, a list of DSNs, and then the datasource definitions themselves, thus: <verbatim> [ODBC Data Sources] PostgreSQL native localhost = PostgreSQL native driver PostgreSQL OpenLink localhost = PostgreSQL over OpenLink multi-tier [PostgreSQL native localhost] Driver = /usr/lib/postgresql/lib/libodbcpsql.so Host = localhost Server = localhost ServerName = localhost Database = tim UserName = tim UID = tim Port = 5432 [PostgreSQL OpenLink localhost] Description = PostgreSQL, over openlink MT Driver = /opt/openlink/lib/oplodbc.so ServerType = PostgreSQL95 Host = localhost Database = tim Username = tim LastUser = tim User = tim FetchBufferSize = 99 [ODBC] ;Trace = 1 ;TraceFile = /tmp/odbctrace.log ;Debug = 1 ;DebugFile = /tmp/odbcdebug.log </verbatim> The list of ODBC Data Sources correlate with the file <code>odbcinst.ini</code> (or environment variable <code>ODBCINSTINI</code>): for every value used as a description of the driver, there should be a corresponding section in <code>odbcinst.ini</code> listing both the <code>Driver</code> and <code>Setup</code> library (to assist with graphical configuration using <code>iodbcadm-gtk</code>, and also used to display an input box in the event of insufficient options being presented at connection-time). The list of attributes is driver-dependent, as the above shows: the native <code>postgresql</code> driver calls them different things from <nop>OpenLink UDA Enterprise Edition, so you have to check your driver's documentation. With iODBC, assuming you downloaded/installed/compiled it, you have a GTK-based GUI for configuring your ODBC DSNs, too: run <code>iodbcadm-gtk</code>. ---+++Just get me connected! This is the succinct overview: Grab the source. Unpack it. Run <verbatim> ./configure &amp;&amp; nice make &amp;&amp; sudo make install </verbatim> Install an ODBC driver for your backend database. Configure <code>odbc.ini</code> to use this driver. Export the environment variable <tt>ODBCINI</tt> to point to that <code>odbc.ini</code>. Run <tt>iodbctest</tt> and attempt to connect. Voila. ---+++I've got this linux box with PHP and Apache... ...and you want to connect to SQL Server or MS Access from it. The overview of the architecture is as follows: <code>apache</code> invokes <code>php</code> to handle scripts, <code>php</code> is linked against <code>libiodbc</code> in order to handle the <code>odbc_*</code> functions in your script, <code>libiodbc</code> loads either a native SQL Server driver for linux or some generic ODBC-proxy for MS Access, and you're done. <nop>OpenLink produce an <i>odbc agent</i> that facilitates the latter sort of connection. The [[http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/IODBCPHPHOWTO][iODBC+PHP+Apache HOWTO]] document on this site will guide you through a working set of configure options for <code>libiodbc</code>, <code>apache</code>, and <code>php</code> in order. ---+++What's a libiodbc and what goes in my Driver= lines in odbc.ini? The ODBC architecture separates the application, the driver-manager and the driver components, each one calling the next in a chain. The <code>libiodbc.so</code> library only implements a driver manager; you need a separate driver for each kind of backend database to which you connect, but your application will at least see one consistent interface across all of them. If you attempt to use <code>Driver=libiodbc.so</code> in the <code>odbc.ini</code>, it will fail. The <code>Driver=</code> parameter should be a full name to a shared-library implementing the driver for the backend database to which you're connecting: <verbatim> [pglocal] Driver = /usr/local/lib/psqlodbc.so Port = 5432 ServerName = localhost Database = me UserName = me Password = [OpenLink] Description = PostgreSQL, over openlink multi-tier Driver = /opt/openlink/bin/oplodbc.so ServerType = PostgreSQL95 Host = otherbox Database = me Username = me FetchBufferSize = 99 </verbatim> More recent versions of iODBC permit use of <code>{ }</code> for quotations and symbolic names for the driver (referencing the <code>odbcinst.ini</code> file), such as <verbatim> Driver = {SQL Server} </verbatim> Older versions of iODBC implemented neither of these; the <code>Driver=</code> parameter had to be a full path directly to the shared library. ---++Common Error Messages ---+++<nowiki>[iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded, SQLSTATE=IM002</nowiki> There are several reasons why this message could occur. The best solution is to trace through what's happening: your application has been linked against <code>libiodbc</code>, which has tried to find an <code>odbc.ini</code> file one way or another - either through the <code>ODBCINI</code> environment variable or the fall-back paths (typically <code>/etc/odbc.ini</code>, depending on how it was compiled). You should check that such a file exists in a suitable location, and that it is accessible (particularly if your application runs with different user privileges - such as <code>apache</code>/<code>php</code> running as a www-data user). Additionally, it could be that iODBC has found a suitable <code>odbc.ini</code> file, but none of the file(s) found contain the DSN you've requested. Check the syntax of your request - is the ODBC connect-string correct, and does the DSN you're requesting exist? See also the section of this FAQ entitled <i>[[#What%27s%20an%20odbc.ini%20and%20what%20do%20I%20put%20in%20it%3F][What's an odbc.ini and what do I put in it?]]</i> ---+++<nowiki>[iODBC] [Driver Manager]Specified driver could not be loaded</nowiki> As in the previous error case, there are a few reasons why this could occur, and thinking through the architecture helps. Your application has loaded <code>libiodbc</code> successfully, and it has found an <code>odbc.ini</code> file (or equivalent through the <code>ODBCINI</code> environment variable), and it has found a DSN within that <code>odbc.ini</code> that matches the name requested in your connection. However, the driver manager has had problems loading the library specified in the <code>Driver=</code> line of that DSN definition. Either it doesn't exist, or its permissions are insufficient to allow your application to load it (it must be readable and executable, and the directories leading down to it must be executable), or maybe the file is not a dynamic library -- it could be a static library (a <code>*.a</code> file, except on AIX) -- or is otherwise corrupted. These are all things to check, or you may be best off reinstalling the driver if all the permissions check out. Note also the prior point: the <code>Driver=</code> parameter <b>must</b> lead to a shared-library (<code>*.so</code>) implementing an ODBC driver for the database to which you're connecting. ---++Driver-Specific Errors ---+++<nowiki>MyODBC: [TCX][MyODBC]No DSN entered (0) SQLSTATE=S1000</nowiki> This error is raised whenever you attempt to connect to <nop>MyODBC using the <code><nop>SQLDriverConnect()</code> function with the <code><nowiki>SQL_DRIVER_PROMPT</nowiki></code> option. Normally, <code><nowiki>SQL_DRIVER_PROMPT</nowiki></code> means the driver should invoke a graphical dialog to request missing information (<code>DSN=</code>, or username and password if not included); however, <nop>MyODBC has no graphical library and does not distinguish the case that a graphical prompt is unavailable from when there is insufficient information, so you always see this error message. <code>iodbctest</code> and <code>iodbctestw</code> from versions 3.52.1 and 3.52.2 both request connections using <code><nowiki>SQL_DRIVER_PROMPT</nowiki></code>, causing this problem with <nop>MyODBC. The workaround is to edit <code>iodbctest.c</code> such that the <code><nowiki>SQLDriverConnect()</nowiki></code> and <code><nowiki>SQLDriverConnectW()</nowiki></code> calls use <code><nowiki>SQL_DRIVER_COMPLETE</nowiki></code> instead. This still allows drivers with graphical setup routines to ask for additional information, but works better with drivers that have no graphical routines, such as <nowiki>MyODBC</nowiki>. See the following diff: <verbatim> Index: iodbctest.c =================================================================== RCS file: /opldev/opensource/iODBC/samples/iodbctest.c,v retrieving revision 1.22 retrieving revision 1.21 diff -u -u -r1.22 -r1.21 --- iodbctest.c 2005/07/19 10:19:01 1.22 +++ iodbctest.c 2005/02/15 17:08:13 1.21 @@ -297,12 +297,12 @@ #ifdef UNICODE strcpy_A2W (wdataSource, (char *) dataSource); status = SQLDriverConnectW (hdbc, 0, (SQLWCHAR *) wdataSource, SQL_NTS, - (SQLWCHAR *) outdsn, NUMTCHAR (outdsn), &buflen, SQL_DRIVER_COMPLETE); + (SQLWCHAR *) outdsn, NUMTCHAR (outdsn), &buflen, SQL_DRIVER_PROMPT); if (status != SQL_SUCCESS) ODBC_Errors ("SQLDriverConnectW"); #else status = SQLDriverConnect (hdbc, 0, (SQLCHAR *) dataSource, SQL_NTS, - (SQLCHAR *) outdsn, NUMTCHAR (outdsn), &buflen, SQL_DRIVER_COMPLETE); + (SQLCHAR *) outdsn, NUMTCHAR (outdsn), &buflen, SQL_DRIVER_PROMPT); if (status != SQL_SUCCESS) ODBC_Errors ("SQLDriverConnect"); #endif </verbatim> This change is included in the iODBC 3.52.3 and later. ---++Segfault with Perl DBD::ODBC Certain platforms (most notably Debian GNU/Linux 5.0.4 ("Lenny", currently stable)) ship with version 1.13-5 of Perl's <code>DBD::ODBC</code> module. On 64-bit OS, this has a bug that causes a segfault. The solution is to upgrade to at least 1.17 (may be found in "Squeeze", currently the Testing distribution). ---++Tracing Application Behavior In the above <code>odbc.ini</code> snippet, we saw commented-out lines concerning tracing. These lines would enable us to analyze what ODBC calls the driver manager sees an application make, with details including parameters, return states, etc. To enable this, uncomment the lines in your <code>odbc.ini</code>: <verbatim> [ODBC] Trace = 1 TraceFile = /tmp/odbctrace.log Debug = 1 DebugFile = /tmp/odbcdebug.log </verbatim> In iODBC version 3.51.0 and above, the <code>TraceFile</code> option now understands a handful of variables: <verbatim> $P Process ID $U User ID under which the process is currently running $T Timestamp in YYYYMMDDHHMMSS format $H Home directory of the user that started the process </verbatim> Also, from version 3.52.7 onwards, <code><nop>TraceFile</code> now takes an option <verbatim> $S Sequence number </verbatim> These are case-insensitive. Hence you could specify -- <verbatim> TraceFile=/tmp/iodbc-$U-$P-$T.log </verbatim> -- and it would include your userid, the application process-id, and the timestamp when ODBC was invoked, in the trace log filename. ---+++Tracing Application Behavior As of release 3.52.5, iODBC has support for File DSNs - where the connection parameters are stored in a separate file per DSN, under a standard directory. To configure these, either use the <b><nop>FileDSN</b> tab alongside System and User DSNs in the iODBC graphical administrator (<code>iodbcadm-gtk</code> or the macOS GUI), or edit files in <code>/etc/ODBCDataSources/</code> for yourself. <img src="%ATTACHURLPATH%/iodbcadm-gtk-filedsn.png" alt=""> Note that this directory must have suitable permissions for those you wish to be able to create, edit, and remove files to do so. For example, <code>1775</code> might be suitable - the owner and members of the group owning the directory can create, remove, and edit their own DSNs, but not those owned by a different user. To use a File DSN, replace the <code>DSN=</code> parameter in your ODBC connection string with <code><nowiki>FileDSN=</nowiki></code>, for example <verbatim> iodbctest FileDSN=localvirtuoso;UID=dba;PWD=secret </verbatim>
sioc:topic
n6:iodbcWiki
sioc:attachment
n22:png