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
Solved

How to get version of MDB from VB

Posted on 1998-10-22
14
531 Views
Last Modified: 2006-11-17
How to get version of Access for an MDB file using VB code?
0
Comment
Question by:dvsraju
  • 5
  • 4
  • 3
  • +2
14 Comments
 
LVL 5

Expert Comment

by:kulikuli
ID: 1966341
Before being able to read the version you should append a property to the database object using the CreateProperty method.
Then set its value to the version you want to.
Then you are able to retreive the version from VB by reading the property's value.
0
 
LVL 5

Expert Comment

by:kulikuli
ID: 1966342
You can enumerate the properties by looping through the database's Properties collection

On creating properties:
There are a couple of examples to be found in the Help-file at the following topics:
CreateProperty
AllowByPassKey
0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1966343
Or you can try this:

Print SysCmd(7)
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 5

Expert Comment

by:kulikuli
ID: 1966344
Helicopter, does this also work from VB?
0
 

Author Comment

by:dvsraju
ID: 1966345
I am looking for an answer on how to get the version from an already existing MDB. I just need to know the version of Access for an existing MDB using VB code.
0
 

Author Comment

by:dvsraju
ID: 1966346
I need to find the Access version for an existing MDB through VB code.
0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1966347
It's still ambiguous. Do you want to be running a database app and report on the version of access that the db is using? (in which case my answer will do the job)

or do you want to (e.g.) list all the mdb files on your drive and have some external application which reports the version for each of them? In which case I think you are going to need a registry search.
0
 

Author Comment

by:dvsraju
ID: 1966348
I need to find the version of several MDB's on a particular drive, but those MDB's may not have been created on that system. So I do not expect the registry search to be of any help for the files that are not created by the system.
0
 
LVL 5

Accepted Solution

by:
kulikuli earned 200 total points
ID: 1966349
try:
set db=currentdb()
msgbox db.properties("AccessVersion")
0
 

Author Comment

by:dvsraju
ID: 1966350
If there are no properties for the MDB file, then this option does not work. Even for those MDB's that have properties, we are getting something like 6.74 or 7.53 for version Access 95 and Access 97 respectively where as I expect to get version 7.0 or 8.0 respectively.
0
 
LVL 5

Expert Comment

by:kulikuli
ID: 1966351
All the MDB's have from version 7.0 and 8.0 HAVE this property. I don't know about version 2.0 but I assume it will be allright(couldn't test it, because I haven't installed it). You are right about the values that differ from the exact version number. But they still are in line with the exact version number. You have to consider that lower than 7.0 it will be MS Access 7.0 and higher than 7.0 it will be 8.0. You should check 2.0 , but I am quite sure it will be lower than 2.0 if the property exists.

Best regards,

kulikuli
0
 
LVL 9

Expert Comment

by:perove
ID: 1966352
Use this instead

Eval(SysCmd(SYSCMD_ACCESSVER))

this give you 7,or ( or whatever)

0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1966353
I already tried that one Perove...(s)he wants the version number of all mdbs on the hard drive without opening them
0
 
LVL 2

Expert Comment

by:lightcross
ID: 11020224
try this site.  its awesome.  you have two options.

1. list all the mdb files on any or all drives connected to your pc (including network drives)

2. a program that allows you to rightclick file and detect version.  it will also allow you to double-click and it will detect and open the correct version of access for that particular file.


http://www.aylott.com.au/accver.htm
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

856 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