473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Application.Version

Bob
Application.Version provides the version of Access being used eg 10 for
Access 2000.

I use some code like:

Set appAccess = CreateObject("Access.Application.8") in Access 97

to open a new instance of Access so that I can create an archive of the
current database. (That took a bit of searching to work it out but it is
working fine in Access 97.....)

I normally work in Access 97 because a) I like it! and b) I am getting too
old to change! and c) I still have customers using it (actually I have a
customer still using Access 2.0 but that is another story..). (I have about
40 clients using the database I am working on and they use Access 97 to XP).

My problem is that when I generated the original code (or pinched it from
somewhere...) I had the code:
Set appAccess = CreateObject("Access.Application.8") which was for Access
97.

When I convert to Access 2000 I don't want to use "Access.Application.8" OR
"Access.Application.10" as appropriate so I changed the code to:

ThisVersion = Application.Version
Set appAccess = CreateObject("Access.Application." & ThisVersion)

This seems to be OK in Access 2000 BUT Access 97 doesn't like the
'Application.Version' ie this wasn't available in Access 97.

Is there some code that I can use that will work in all versions of Access
from 97 onwards that will give me the current version so that i can still
develop in 97 but just convert the database to 2000 and XP??

(I guess that things are somewhat complicated fo r me in that I have Access
2, 97, 2000 and XP all installed (and seemingly working OK, on the one PC!).
Bob
Nov 13 '05 #1
5 7637
I use:
Dim App As Access.Application
Set App = New Access.Application

Nov 13 '05 #2
Sky
>
ThisVersion = Application.Version
Set appAccess = CreateObject("Access.Application." & ThisVersion)

This seems to be OK in Access 2000 BUT Access 97 doesn't like the
'Application.Version' ie this wasn't available in Access 97.

I use:

CreateObject("Access.Application." & Left$(SysCmd(acSysCmdAccessVer), 1))

- Steve
Nov 13 '05 #3
Sky
"lylefair" <ly******@yahoo.ca> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I use:
Dim App As Access.Application
Set App = New Access.Application


I believe this will return the most recent version, which I believe Bob does
not want.

- Steve
Nov 13 '05 #4
Thanks Steve and others. That gave me exactly what I needed.

Had to use Left$(SysCmd(acSysCmdAccessVer), 2)) because of Access 2000
onwards giving 10, 11 etc. but that answered the question.

Gee I LOVE this group - helped me HEAPS over the years!

Nov 13 '05 #5
Sky
"2bob <bxx oyy b @ xcolsoftxx.comx.aux>" <bo*@colsoft.com.au> wrote in
message news:11**********************@g14g2000cwa.googlegr oups.com...
Thanks Steve and others. That gave me exactly what I needed.

Had to use Left$(SysCmd(acSysCmdAccessVer), 2)) because of Access 2000
onwards giving 10, 11 etc. but that answered the question.

Gee I LOVE this group - helped me HEAPS over the years!


You had asked about Access 97, which is Version 8 with one digit:
Left$(SysCmd(acSysCmdAccessVer), 1)) = "8"

Similarly Access 2000 is Version 9, also with one digit.

For Access 2002 onwards, you need two digits, as you state:
Left$(SysCmd(acSysCmdAccessVer), 2))

A generic solution for all versions might be:

Left$(SysCmd(acSysCmdAccessVer), InStr(SysCmd(acSysCmdAccessVer), ".") - 1)

- Steve

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding...
3
by: Keith | last post by:
I am using the built-in setup installer which comes with VS 2003. I am always having problems running the application on other machines other than my development machines with VS. It seems like...
3
by: Karuppasamy | last post by:
Hi I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net . I installed everything as per the Instructions given in the 'Development Using the Logging Block'. ...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
1
by: Reza Sadeghi | last post by:
Hi I am getting this error when I tried to browse any asp.net in visual studio.net. I can build the project but when I try to run and debug the project I get error message that "Unable to start...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
10
by: appdevtech | last post by:
A little background… We have multiple web servers in a farm and are starting to upgrade some applications to 1.1 by re-compiling in VS2003. One of the things out of our direct control is the...
5
by: Lyners | last post by:
I have a VB.NET application that is deployed to an end user. I would like to display on screen the application version of the application so that I know the end user id using the latest version of...
6
by: Aussie Rules | last post by:
Hi, I use the publish feature within Vs.net 2008, and have it set to increment on each build/publish I want to be able to display this as my application version number, but can not see how to...
0
by: Pheasant Plucker® | last post by:
Hi there, Not sure if this is the correct ng and I am not a programmer so excuse me but here goes...:-) We have a custom application that has a hook or calls either the Outlook calendar or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.