473,770 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically determining if Access is installed and which version

RWC
Hi Folks,

I'm looking for a way to determine if the client machine has access
installed and if so, what version. The reason I need this is to determine
(programaticall y) if the Access Runtime is required to be installed and if
not, which version of the program database needs to be installed with the
current version of Access. (hope that makes sense).

If anyonoe could point me in the right direction, I'd really appreciate it.

Thanks in advance!
Rick
Nov 13 '05 #1
2 1820
Br
RWC <rc************ ******@hemmingw ay.com> wrote:
Hi Folks,

I'm looking for a way to determine if the client machine has access
installed and if so, what version. The reason I need this is to
determine (programaticall y) if the Access Runtime is required to be
installed and if not, which version of the program database needs to
be installed with the current version of Access. (hope that makes
sense).
If anyonoe could point me in the right direction, I'd really
appreciate it.
Thanks in advance!
Rick


check out http://www.mvps.org/access/
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #2

"RWC" <rc************ ******@hemmingw ay.com> wrote in message
news:Ybpie.1389 236$8l.321516@p d7tw1no...
Hi Folks,

I'm looking for a way to determine if the client machine has access
installed and if so, what version. The reason I need this is to determine
(programaticall y) if the Access Runtime is required to be installed and if
not, which version of the program database needs to be installed with the
current version of Access. (hope that makes sense).

If anyonoe could point me in the right direction, I'd really appreciate it.
Thanks in advance!
Rick


My logic is that since normally mdb is associated with access, we can find
the application associated with mdb then find the file version. I have not
tested this code but give it a shot:

' Calling code in form

exePath = GetAccessPath
exeversion = GetVersion(Trim (exePath))
'===module level
Option Explicit
Public gAccessExists As Boolean
Public gAccessPath As String

Public Declare Function FindExecutable Lib "shell32" _
Alias "FindExecutable A" _
(ByVal lpFile As String, _
ByVal lpDirectory As String, _
ByVal sResult As String) As Long

Public Declare Function GetTempPath Lib "kernel32" _
Alias "GetTempPat hA" _
(ByVal nSize As Long, _
ByVal lpBuffer As String) As Long

Public Const MAX_PATH As Long = 260
Public Const ERROR_FILE_NO_A SSOCIATION As Long = 31
Public Const ERROR_FILE_NOT_ FOUND As Long = 2
Public Const ERROR_PATH_NOT_ FOUND As Long = 3
Public Const ERROR_FILE_SUCC ESS As Long = 32 > is good
Public Const ERROR_BAD_FORMA T As Long = 11

Private Const ERROR_SUCCESS As Long = 0

Private Type FIXEDFILEINFO
dwSignature As Long
dwStrucVersionl As Integer
dwStrucVersionh As Integer
dwFileVersionMS l As Integer
dwFileVersionMS h As Integer
dwFileVersionLS l As Integer
dwFileVersionLS h As Integer
dwProductVersio nMSl As Integer
dwProductVersio nMSh As Integer
dwProductVersio nLSl As Integer
dwProductVersio nLSh As Integer
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type

Private Declare Function GetFileVersionI nfo Lib "Version.dl l" Alias
"GetFileVersion InfoA" (ByVal lptstrFilename As String, ByVal dwhandle As
Long, ByVal dwlen As Long, lpData As Any) As Long

Private Declare Function GetFileVersionI nfoSize Lib "Version.dl l" Alias
"GetFileVersion InfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As
Long) As Long

Private Declare Function VerQueryValue Lib "Version.dl l" Alias
"VerQueryValueA " (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As
Any, puLen As Long) As Long

Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMem ory" (dest As
Any, ByVal Source As Long, ByVal length As Long)

' Find what is associated with mdb

Public Function GetmdbAssociati on(dwFlagReturn ed As Long) As String
Dim sTempFolder
Dim hfile
Dim sResult As String

'get the user's temp folder
sTempFolder = GetTempDir()

'create a dummy mdb file in the temp dir
hfile = FreeFile
Open sTempFolder & "dummy.mdb" For Output As #hfile
Close

'get the file path & name associated with the file
sResult = Space$(MAX_PATH )
dwFlagReturned = FindExecutable( "dummy.mdb" , sTempFolder, sResult)

'clean up
Kill sTempFolder & "dummy.mdb"

'return result
GetmdbAssociati on = TrimNull(sResul t)

End Function
Public Function TrimNull(item As String)
Dim pos As Integer
pos = InStr(item, Chr$(0))
If pos Then
TrimNull = Left$(item, pos - 1)
Else
TrimNull = item
End If
End Function
Public Function GetTempDir() As String
Dim nSize As Long
Dim tmp As String
tmp = Space$(MAX_PATH )
nSize = Len(tmp)
Call GetTempPath(nSi ze, tmp)
GetTempDir = TrimNull(tmp)
End Function

Public Function GetAccessPath() As String
Dim b$
Dim success As Long
'success is passed and filled in the routine
b$ = GetmdbAssociati on(success)

'possible return values from the call
'returned in success
Select Case success

'the call succeeded
Case Is >= ERROR_FILE_SUCC ESS '>32 good
gAccessExists = True

'other possible return values
'Case ERROR_FILE_NO_A SSOCIATION
'Case ERROR_FILE_NOT_ FOUND
'Case ERROR_PATH_NOT_ FOUND
'Case ERROR_BAD_FORMA T
gAccessPath = b$
Case Else
gAccessExists = False
End Select
GetAccessPath = b$
End Function

Public Function GetVersion(sPat h) As String
Dim rc As Long
Dim lDummy As Long
Dim sBuffer() As Byte
Dim lBufferLen As Long
Dim lVerPointer As Long
Dim udtVerBuffer As FIXEDFILEINFO
Dim lVerbufferLen As Long

On Error GoTo GetFileVersion_ Error

'*** Get size ****
lBufferLen = GetFileVersionI nfoSize(sPath, lDummy)
If lBufferLen < 1 Then
GetVersion = ""
Exit Function
End If

'**** Store info into struct ****
ReDim sBuffer(lBuffer Len)
rc = GetFileVersionI nfo(sPath, 0&, lBufferLen, sBuffer(0))
rc = VerQueryValue(s Buffer(0), "\", lVerPointer, lVerbufferLen)
MoveMemory udtVerBuffer, lVerPointer, Len(udtVerBuffe r)
' a very very long line below
GetVersion = Format$(udtVerB uffer.dwFileVer sionMSh) & "." &
Format$(udtVerB uffer.dwFileVer sionMSl) & "." &
Format$(udtVerB uffer.dwFileVer sionLSh) & "." &
Format$(udtVerB uffer.dwFileVer sionLSl)

On Error GoTo 0
Exit Function

GetFileVersion_ Error:
GetVersion = ""
End Function
Nov 13 '05 #3

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

Similar topics

1
5411
by: RWC | last post by:
Hi Folks, I'm looking for a way to determine if the client machine has access installed and if so, what version. The reason I need this is to determine (programatically) if the Access Runtime is required to be installed and if not, which version of the program database needs to be installed with the current version of Access. (hope that makes sense). If anyonoe could point me in the right direction, I'd really appreciate it.
1
1940
by: Rahul Apte | last post by:
How do I programmatically check whether ASP and Server Side Includes sub-components of the World Wide Web service are installed on a Windows 2003 Box? I want to do these checks as pre-install checks for a software. Thanks in advance. - Rahul A.
2
5969
by: Richard L Rosenheim | last post by:
How can I determine which version of MDAC is installed on the machine. I have a program which works on one machine, but not another and I would like to confirm whether or not the two machines have the same version of MDAC installed. TIA, Richard Rosenheim
7
8869
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6600
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
4
7187
by: Br | last post by:
We're using an Access2000 ADP with an SQL2000 back-end. Because SQL2000 was released after Access2000 you need to be running Access2000 SP1 (2 or 3) for it to work properly. Is there an easy way for the ADP to determine programatically wether the correct service pack is installed (or if they are using a newer version such as 2002/2003)? Ta.
1
3420
by: Khadim | last post by:
greetings, i am trying to develop an application which is supposed to show pdf. i have added the activeX control from the acrobat in my application. everything was working fine, until i got to test it on another system which had acrobat 6.0 installed.... there my application gave error while loading. I have acrobat 7.0. the solution i this is to get acrobat contorl programatically and not through adding components at design time. i...
23
2652
by: Reggie | last post by:
Hi and TIA. I developed several A2K dbs which are now being run on my clients computer which have been upgraded to Access 03. I'm not sure exactly what they mean but of you know or could point me in a direction to find info on how to prevent and/or fix the db's so that these message don't pop up when the app is started. Error messages below: 1. Microsoft Jet 4.0 service pack 8 must be installed to block unsafe expressions without...
4
21749
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the service A executable, stop service A, replace the executable with the new copy, and start service B...
17
7667
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many do not, and it's not clear when they would get it. His thought was to use the upcoming Access 2007 runtime to allow the users who are still running Office 2003 to be able to run the database. While I use multiple versions of Access on my...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.