title: ODBC Issue in Red Hat linux release 6.9:
body: <h1>ODBC Issue</h1>
  <p><code>The database reported an error: [unixODBC][Driver Manager]Data Source name not found, and no default driver specified</code></p>
  <p>As shown as below, QT application trying to connect a database file of type DBF (<code>.dbf</code>), when we try to execute the application we got the above error.</p>
  <pre><code>QSqlDatabase db;
  db = QSqlDatabase::addDatabase(&quot;QODBC&quot;);
  
  QString str(&quot;DRIVER={Microsoft dBase Driver (*.dbf)}; DBQ=/path/to/dbf/files&quot;);
  
  db.setDatabaseName(str);
  
  if(db.open())
  {
      ...
  }
  else
  {
      ...// Failure
  }
  </code></pre>
  <p>Referred the link (<a href="https://www.easysoft.com/support/kb/kb01039.html" rel="nofollow noreferrer">https://www.easysoft.com/support/kb/kb01039.html</a>) and followed the below steps:</p>
  <ol>
  <li>The configuration files <code>odbc.ini</code> and <code>odbcinst.ini</code> are present with the appropriate content.</li>
  <li>Exported the variables <code>ODBCSYSINI</code>, <code>ODBCINSTINI</code> and <code>ODBCINI</code> with  <code>/etc/odbc.ini</code>, <code>/etc/odbcinst.ini</code> and <code>/home/user/.odbc.ini</code></li>
  <li>From the same shell where we have exported the variables, tried to execute the application however encountered with the error &quot;The database reported an error: <code>[unixODBC][Driver Manager]Data Source name not found, and no default driver specified</code></li>
  </ol>
  <p>Please find the content of the <code>odbc.ini</code> and <code>odbcinst.ini</code></p>
  <h3><code>odbc.ini</code> file:</h3>
  <pre><code>[ODBC Data Sources]
  TestODBC=MyODBCDriver
  
  [TestODBC]
  Driver=path/to/driver file
  DataDirectory=path/to/where my dbf files resides
  
  [Default]
  Driver=path/to/driverfile
  DataDirectory=path/to/where my dbf files resides
  </code></pre>
  <h3><code>odbcinst.ini</code> file:</h3>
  <pre><code>[ODBC Drivers]
  MyODBCDRIVER=Installed
  
  [MyODBCDriver]
  Description=ODBC Driver
  Driver=/path/to Driver file
  
  [ODBC]
  Trace = Yes
  </code></pre>
  <p>Please provide any suggestion or solution to resolve the issue</p>