VistaDB 5 can open VistaDB 4 database files only if you are performing an upgrade (PackDatabase) *or* if you are opening in read-only mode. If you are opening for read-write then in theory there is a particular error thrown that an upgrade is required.
If opened successfully (in read-only mode for a VistaDB 4 database file), there are some bool properties (added in VistaDB 5) on the IVistaDBDatabase interface. IsDatabaseCurrentFormatVersion tells you whether the opened database is already in the format which the engine version you are using would use when packing the database (false means it will upgrade). CanDatabaseVersionEncryptPages may also be helpful as it will be false for any pre-VistaDB5 database and will be true for VistaDB5-and-later databases because we changed the encryption approach on that boundary.
Hi - we finally decided to take the plunge and bring VDB up to Version 5.1, partly because we're bringing the underlying app to .NET4.
As part of this effort, we will need our program to open the old version 4 database (which has an extension of .PTPED), and detect that it is a VistaDB 4 database,
If the database is VDB4, then we pack it on the spot to upgrade it. If it is not, then we skip the step.
It seems that your instructions say that the means of detection if the file extension; that is not an option for us. Is there something we could do to either tell us the database version, or something that would generate a known exception that we could catch, and thereby know that we need to upgrade the database?