I have an Excel based tool that updates and pulls data from an Access database. I'm currently running Office 2007.
The connection string for Access 2007 is "Provider=Microsoft.ACE.OLEDB.12.0....". This connection string works fine. I know that the connection string for an Access 2010 DB is "Provider = Microsoft.ACE.OLEDB.14.0...."
I want to be able to use an Access 2010 DB when the upgrade is applied without having to change the code. I did this sort of thing with an Access 2003 DB by testing the Access file extension so that when the database was upgraded to Access 2007 the transition was automatic.
The problem is that the file extension for Access 20007 and 2010 is the same. Are there any suggestions other than if the connection to Access 2007 throws an error to automatically try the 2010 connection string? I don't yet have Access 2010 so I can't test this but I prefer to anticipate the upgrade.