title: Access Visual FoxPro database from Java
body: <p>I've been trying to access a Visual Fox Pro database from Java for a week now. I'm getting desperate because my project is in a very tied budget and timeframe. (As any other project, I guess, hahaha)</p>
  
  <p>I have a <code>.dbf</code>, a <code>.cdx</code> and a <code>.fpt</code> files. I need to be able to look for a record, extract data, and update data. I don't have a VFP licence.</p>
  
  <p>I hope someone has some pointers or a working example that I can use. If the only way is buying a driver I'll be willing to consider it based on suggestions received.</p>
  
  <p>This is a short description of what I have tried.</p>
  
  <p>I found this <a href="http://xbasej.sourceforge.net/" rel="nofollow noreferrer">xBaseJ: java objects to read and write to dBase files</a>. But it doesn't suport CDX index files.</p>
  
  <p>Also found this <a href="https://stackoverflow.com/a/8079987/2796922">Example to access a dbf</a>. But my tests show this exception: <code>java.sql.SQLException: [Microsoft][Controlador ODBC dBase] La tabla externa no tiene el formato esperado.</code>
  I guess a translation to english of this error could be something like: <code>java.sql.SQLException: [Microsoft][ODBC dBase Driver] External table is not in the expected format</code> </p>
  
  <p>Because of that error I think I need a newer driver. In <a href="http://msdn.microsoft.com/en-US/vfoxpro/bb190232" rel="nofollow noreferrer">this microsoft page</a> say they no longer have an ODBC driver, and everybody should use OLE DB Provider. The problem is I haven't found a way to use it from java. </p>
  
  <p>As far as I can tell, <a href="https://community.oracle.com/thread/1326929?start=0&amp;tstart=0" rel="nofollow noreferrer">there is no way</a> to do it directly. Found <a href="https://stackoverflow.com/questions/1440900/connect-to-oledb-data-source-from-java">here</a> someone talking about a JACOB "thingy", and someone comments about the need to create a C++ or C# "something" to be able to do what I need. I think he is talking about <a href="http://danadler.com/jacob/" rel="nofollow noreferrer">The JACOB Project: A JAva-COM Bridge</a>. But I also don't know what COM calls would actually have to make.</p>
  
  <p>Haven't been able to find a suitable JDBC driver. </p>
  
  <p>Thank you all.</p>
  
  <p>Ely.</p>