[RESOLVED] [2005] Get Access Jet version question
Hello,
Is it possible to get the version of jet an access file requires? I have been looking at File and File attributes under System.IO, and I was trying to see if it was possible with OleDb, but I couldn't find a way to direct it to a file, without setting the connection string.
Thank you for your help.
Re: [2005] Get Access Jet version question
Install the latest version, then you're covered.
Re: [2005] Get Access Jet version question
Quote:
Originally Posted by Krenshau
Hello,
Is it possible to get the version of jet an access file requires? I have been looking at File and File attributes under System.IO, and I was trying to see if it was possible with OleDb, but I couldn't find a way to direct it to a file, without setting the connection string.
Thank you for your help.
You can't. You have to know.
1 Attachment(s)
Re: [2005] Get Access Jet version question
it MIGHT be possible if you open the mdb file and read in the file header info.
Here is a screenshot when looking at an access 2003 (jet 4.0) mdb file in a hex editor. Note it clearly states 4.0 and I am assuming that value is supposed to be the JET version. I don't have a 3.51 MDB file to test against.
However I think using JET 4.0 in your connection string should work for opening 3.51 version MDB files no?
Re: [2005] Get Access Jet version question
Thank you all for your replies.
When I was googling last night, I found that the file header could be read as you suggested, Kleinma, but I didn't know if that could be done in Visual Basic 2005.
Basically, what I am trying to accomplish is to make kind of a smart program that the user can select a database file and the program will identify the type of database it is (within a predefined amount of types) and use the correct connection string to open it.
I was looking at connectionstrings.com, and saw that access 2007 uses a different type of connection string that previous versions of access, so that is what started my need to make the program "smarter".
Can the file header be read using visual basic 2005? If not, is there another way to do this. I am expecting my users to not be smart enough to know what type of access database they have.
Thank you for your help.
Re: [2005] Get Access Jet version question
With VB you can open the file and read in the bytes and interpret the data yourself via code, but there is no function thats is going to make it a quick few lines of code to accomplish that.
However like I mentioned above, get your hands on an Access 97 MDB file, and see if a JET 4.0 Connection String will open it just fine. I have a feeling it might. You couldn't open a JET 4.0 DB with a 3.51 connection string, but JET 4.0 might offer backwards compatibility with older MDB files.
Re: [2005] Get Access Jet version question
Ok, I found out that access 2007 uses a .accdb extension, and uses this as a connection string.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;
So, the short story is that I will just check the extension. I didn't know they changed it.
Thank you for your help.
Re: [RESOLVED] [2005] Get Access Jet version question
They changed it because all the Office file formats have changed to XML-based. MDB is a binary file but I think that ACCDB is the new XML-based format.
It's always a good idea to give some background on your question. If you'd said in the first place that you wanted to connect to an Access 2007 database then we could have helped with that specifically.
Re: [RESOLVED] [2005] Get Access Jet version question
I didn't want to know how to connect to an access 2007 database, but I understand your point.
Thank you for your help.