Determine and update .MDB file version

L

LarryF

I need to figure out which version of Access was used to create a .mdb
file from within .Net, and possibly update it to a more recent version.
In other words, I need to figure out if the file is from Access 97,
Access 2000, etc. I'm using OleDb.

The OleDbConnection.ServerVersion seems to return the OLEDB version,
not the file version. With ADODB, you could use
connection.Properties("Jet OLEDB:Engine Type").Value to find the
version.

Is there any way to find the file version with .Net, and is there any
way to tell Access to update a file to a newer version? Maybe something
in ADOX?

Thanks for any help you can give me.
 
M

Mary Chipman

For what you want, you may be better off using the DAO PIA instead of
ADOX since it has more functionality. The Office XP PIAs are available
from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp
and the Office 2003 PIAs from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stagsdk/html/stconPIAs.asp.
As far as using .NET to perform an actual upgrade to a newer version,
I'm pretty sure that's a non-starter. One solution might be to create
a new mdb using the desired version and import the data from the older
mdb.

--Mary
 
P

Paul Clement

On 5 Jan 2005 11:23:41 -0800, (e-mail address removed) wrote:

¤ I need to figure out which version of Access was used to create a .mdb
¤ file from within .Net, and possibly update it to a more recent version.
¤ In other words, I need to figure out if the file is from Access 97,
¤ Access 2000, etc. I'm using OleDb.
¤
¤ The OleDbConnection.ServerVersion seems to return the OLEDB version,
¤ not the file version. With ADODB, you could use
¤ connection.Properties("Jet OLEDB:Engine Type").Value to find the
¤ version.
¤
¤ Is there any way to find the file version with .Net, and is there any
¤ way to tell Access to update a file to a newer version? Maybe something
¤ in ADOX?

You can use the undocumented (and unsupported) DAO Database object property AccessVersion:

CurrentDb.Properties("AccessVersion").Value

If you want to upgrade to a newer version of Access you can use the CompactDatabase method, however
it will not convert Access application specific objects such as Reports, Forms, etc.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top