title: Which version of Interbase or Firebird was a database created under?
body: <p>I have a file with an extension <code>.ib</code>. I am guessing it is either an <strong>Interbase</strong> or a <strong>Firebird</strong> file, but I am having trouble working out exactly which. Furthermore, it isn't clear exactly which <em>version</em> of Interbase (or Firebird) was used to create the file.</p>
  
  <p>What I have found so far:</p>
  
  <p>I have tried various different software to read this file (FlameRobin, Firebird's isql.exe and also the latest version of Interbase) and the error messages I get tell me the ODS ("On Disk Structure") is version 9. Which is quite old, and dates to around the time that Firebird was forked from Interbase.</p>
  
  <p>I have managed to connect to the database and query it using Firebird, but some errors I'm getting lead me to believe it is actually an Interbase database (I can explain further if required)</p>
  
  <p>Is there a fool proof way of determining <em>exactly</em> what sort of database I'm dealing with? i.e. is it an Interbase or Firebird file and if so which version was it written with?</p>
  
  <p>Edit:
  The output of <code>gstat.exe -h</code> run using Firebird 2.5:</p>
  
  <pre><code>Database header page information:
      Flags           0
      Checksum        12345
      Generation      7558
      Page size       4096
      ODS version     9.1
      Oldest transaction  7506
      Oldest active       7544
      Oldest snapshot     7544
      Next transaction    7549
      Bumped transaction  1
      Sequence number     0
      Next attachment ID  5
      Implementation ID   16
      Shadow count        0
      Page buffers        0
      Next header page    0
      Database dialect    1
      Attributes      force write
  
      Variable header data:
      Sweep interval:     20000
      *END*
  </code></pre>
  
  <p>To summarise: </p>
  
  <ul>
  <li>Get a copy of Firebird</li>
  <li>Run <code>gstat.exe -h</code> from the bin directory</li>
  <li>Get the ODS version from the output</li>
  <li>Look it up in the <a href="http://www.ibase.ru/devinfo/prevver.htm" rel="nofollow">table here</a></li>
  </ul>