Solved

How do I programmatically detect the file format of a Microsoft Access file?

Posted on 2009-07-14
5
215 Views
Last Modified: 2013-11-27
I'm writing a program in Visual Basic .NET 2008 to automatically update old versions of Microsoft Access files (97) to 2003 format. That's working fine. What I'm looking for is a way to check the file format of an Access file before trying to convert it. If the file is already in the correct format, I want to skip the conversion process.
0
Comment
Question by:Richard Senft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 75
ID: 24852904
Well, inside of Access you can use the SysCmd to get this - for example:

   If SysCmd(acSysCmdAccessVer) = 11 Then
    MsgBox "Access 2003"
   End If

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 24852924
However ... this is more general purpose:

http://www.mvps.org/access/api/api0065.htm

mx
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 24854401
Are you refering to Access "files" as in the MDBs (perhaps even ACCDBs) for conversion and want to externally determine their version?
Bearing in mind this is all in VBA (and from Access itself - but VBA is the only real factor) this link discusses the nuances of MDB and ACCDB version format info accessed via DAO or ADO.
You'll need to invoke the equivalent in VB - though you could always use one of the "old" COM libraries if required. :-p
Cheers.
0
 
LVL 41

Expert Comment

by:graye
ID: 24864373
I think the only way to figure out the version number is to go ahead and open up the MDB file using the OleDb.Jet drivers.   You'll be able to get the Major and Minor version numbers as properties.
But that obviously doesn't help you much... as that means you'll have to open the MDB twice... once to get the version number and again to perform the conversion... a hollow victory
0
 

Author Closing Comment

by:Richard Senft
ID: 31603424
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question