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.
Printable View
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.
Use "application.version"
11 = Access 2003
10 = Access 2002
9 = 2000
8 = 97
etc...
ok, so how could you check for that?
If (application.version = 11)then
msgbox("Access 2003")
End If
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?
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.Once you have retrieved the version, see DKenny post for its translation.VB Code:
'Set A Reference To MS Access Object Library 'Set A Reference to MS DAO 3.6 or later Private Sub Command1_Click() Dim Axs As Access.Application Set Axs = New Access.Application Axs.OpenCurrentDatabase ("c:\codelib\codelibrary.mdb"), False MsgBox Axs.CurrentDb.Version End Sub
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.
What connection method? (DAO/DAO Data Control/ADO DB/ADO DataControl/DataEnvironment/.....?)Quote:
I'm using VB6 in interface with an Access database,
Why is the database version being changed?
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.Quote:
Originally Posted by manofsteel00
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.
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).
Thanks