Detect Database Version prior to opening db

O

Olgun

Hi,

I am working on developing an access db that will be shared among multiple
users. Many people that will be using this app have both access 97 and access
2000 running on their machine. I am trying to figure out a way to detect the
version through vba, prior to getting the standard error message that access
produces if you try opening lets say a v97 db where your default db is set to
v2000 etc..

I can get the version of the db on a Form Load event with either
Application.CurrentDb.Version or SysCmd(acSysCmdAccessVer), but at this
stage the database is already open.

Ultimately I want to prevent users from trying to open and corrupt the
database, if they have access 97 setup as their default db.

Any response would be appreciated.
 
S

Stephen Knapp

Access (97 or otherwise) checks its database versions before any form
actually opens to make sure that it is reading what it can interpret (like
trying to open a TIFF file with MS Paint, it complains about the wrong
format). If your backend was created with A2000, then A97 tries to identify
the proper "format," can't find it, and goes belly-up. Your VBA code never
even gets a chance to do anything. Your best bet is to educate your users,
advising them that the A97 error means go try the other version of Access.
Not to worry, they cannot inadvertantly hurt your A2000 data because A97
won't even get them to it.

Steve in Ohio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top