danglesauce19
danglesauce19

Reputation: 133

Convert multiple .accdb files to .mdb using PowerShell?

I need to convert about 50 .accdb files to .mdb. I know that there is a way to do it in Access itself, but I would rather not open up 50 Access databases to manually convert each.

Is it possible to do this in PowerShell? Would just renaming the extension be enough, or is it more complicated than that?

Upvotes: 1

Views: 1075

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123399

Would just renaming the extension be enough, or is it more complicated than that?

There is definitely more to it than that.

The following code seems to have worked for me. It converted the tables at least. There was a form in the .accdb that didn't get copied over to the .mdb so perhaps it has properties that aren't supported in the older file format (ref: Hans' comment to the question).

$Access = New-Object -com Access.Application
$Access.ConvertAccessProject(
        "C:\Users\Public\test\test.accdb", 
        "C:\Users\Public\test\test2000.mdb", 
        "acFileFormatAccess2000")
$Access.Quit()

Upvotes: 1

Related Questions