Can I check version 2003 in Acc2000?

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi,

I developed an Acc2000 DB. Now some users moved to Office 2003 while other
are still on 2000, and certain code in Acc2000 doesn't work anymore. I want
to be able to tell what Access version a user has and then uses different
code. How can I do that? Thanks.
 
Thanks a lot, Doug.

The things that fails is simple Docmd.OpenReport... It works fine in Access
2000, but says action canceled in Access 2003. Any ideas?
 
It rings a bell, but I can't find any references at the moment.

Try doing a Google search on

+"openreport" +"action cancelled"

There are a bunch of hits.
 
Dan, Microsoft added an OpenArgs to OpenReport in Access 2002. If one of the
users added this to the A2003 code as Doug surmised, it would then fail in
Access 2000.

But A2000 and 2003 also use different binaries for the compiled code, so it
is not uncommon to find that an mdb that has been modified in A2003 fails
nonsensically in A2000. The workaround is to decompile the database in
A2000. To decompile, enter something like this at the command prompt while
Access is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then open a code window in A2000, and choose Compile on the Debug menu to
make sure it compiles.

It should then work until someone opens it in A2003 and messes around with
it again. To prevent that from happening, you might want to create an MDE
using A2000, and distribute an MDE front end to each user instead of the
MDB.

If you do need an example of how to conditionally execute code depending on
the version, there is an example in this article:
http://allenbrowne.com/AppRelReport.html
Follow the "code in this link" to:
http://allenbrowne.com/AppRelReport.txt
and scroll down to the bottom of the code.
The line:
If Int(Val(SysCmd(acSysCmdAccessVer))) >= 10 Then
means the code is skipped in A2000 and earlier.
Note also the use of the literal instead of the constant A2000 lacks.
And the use of Object instead of Report for the argument passed in, so A2000
doesn't complain that Report don't have this property.
 

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

Back
Top