Results 1 to 11 of 11

Thread: [RESOLVED] Opening data from various Access Databases

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Resolved [RESOLVED] Opening data from various Access Databases

    I was wondering if anyone knew how to check to see if a database is 97,2000,2002, or 2003? I need to be able for my data to be accessible to all those types of databases. If anyone can help I would be greatly appreciative.

    Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Opening data from various Access Databases

    Use "application.version"

    11 = Access 2003
    10 = Access 2002
    9 = 2000
    8 = 97
    etc...
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Opening data from various Access Databases

    ok, so how could you check for that?

    If (application.version = 11)then
    msgbox("Access 2003")
    End If

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Opening data from various Access Databases

    That will work inside an Access application. How/where are you trying to run it? (are you using VB6? ADODB? ...).

    Under what circumstances can you not open a database?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Opening data from various Access Databases

    I knew I had a snippet of how to check the version from VB in my Code Library somewhere, and I found it.

    It is for DAO however, but shouldn't pose to big a problem in converting.
    VB Code:
    1. 'Set A Reference To MS Access Object Library
    2. 'Set A Reference to MS DAO 3.6 or later
    3.  
    4. Private Sub Command1_Click()
    5. Dim Axs As Access.Application
    6. Set Axs = New Access.Application
    7. Axs.OpenCurrentDatabase ("c:\codelib\codelibrary.mdb"), False
    8. MsgBox Axs.CurrentDb.Version
    9. End Sub
    Once you have retrieved the version, see DKenny post for its translation.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Opening data from various Access Databases

    I'm using VB6 in interface with an Access database, the program is ran on multiple computers and the database is being opened by different Access databases (2003,2002,200,97). SO I need to keep the original database on the network drive from being corrupt or changed to an older database.

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Opening data from various Access Databases

    I'm using VB6 in interface with an Access database,
    What connection method? (DAO/DAO Data Control/ADO DB/ADO DataControl/DataEnvironment/.....?)


    Why is the database version being changed?

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Opening data from various Access Databases

    ADO DB, I believe the database is being changed due to people going into the database its self. I if were to put a lock on the database would VB6 still be able to connect to it?

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Opening data from various Access Databases

    Quote Originally Posted by manofsteel00
    ADO DB, I believe the database is being changed due to people going into the database its self. I if were to put a lock on the database would VB6 still be able to connect to it?
    This isn't going to change the version of the database. An Access 2000 database is going to remain an Access 2000 database regardless of how many records are being added.

    Someone would have to open the database with Access 2003, and explicitly convert it before it would become an Access 2003 database. It is not something you could do accidentaly.

  10. #10
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Opening data from various Access Databases

    Yep.

    If you put a password on the database then people wont be able to open it, but you can via your program (you just need to alter the connection string, see link below).

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Opening data from various Access Databases

    Thanks

    Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.

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