How to programmatically convert Access 1997 .mdb to Access 2007 .accdb
<p>I'm in the starting process of building an application that walks through a folder structure, starting at a given root path, and converts all found Access 1997 .mdb files into the newer Access 2007/2010 .accdb format. However, I'm running into some troubles when doing to actual file conversion.</p>

<p>I'm using Microsoft's Access Interop API (<a href="https://msdn.microsoft.com/en-us/library/office/ff193465.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/ff193465.aspx</a>) to handle the conversion, so this has to be written in VBScript. Script is below:</p>

<pre><code>Dim app 
Set app = CreateObject("Access.Application")
app.ConvertAccessProject "C:\Users\[User]\Access Conversion Utility\sample.mdb", "C:\Users\[User]\Access Conversion Utility\converted.accdb", acFileFormatAccess12
</code></pre>

<p>When run, I get the error "The project cannot be converted into this format. The project can only be converted to Access 2000 or newer format." Yet, this same error message shows up regardless of the file parameter enum value, be it 'acFileFormatAccess97' or 'acFileFormatAccess2000'. Does anyone know the details of this error and what a possible solution could be? I've tried changing the extension of the second parameter, thinking that was part of the issue, but this made no changes to the error message.</p>

<p>The sample file I'm using is able to be opened in Access just fine, it's just the conversion itself that fails.</p>

<p>By all means, if anyone has a better idea or approach to do the conversion programatically, I would love to hear it, but this is the only one I was able to find. The plan is to run this script from a GUI application written in C#, but also allow for the application to be run via the command line as well.</p>