Results 1 to 9 of 9

Thread: [RESOLVED] [2005] Get Access Jet version question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Resolved [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.
    Ben


    Using Visual Basic 2005/2008

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Get Access Jet version question

    Install the latest version, then you're covered.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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?
    Attached Images Attached Images  

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    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.
    Ben


    Using Visual Basic 2005/2008

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    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 OLEDBatabase 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.
    Ben


    Using Visual Basic 2005/2008

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    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.
    Ben


    Using Visual Basic 2005/2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width