472,126 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Q: Which Access version

Hi

How can I find which version of Access is installed on a computer from
within a vb.net application?

G
Mar 2 '07 #1
8 1540
On Mar 2, 3:20 am, "G .Net" <nodamns...@email.comwrote:
Hi

How can I find which version of Access is installed on a computer from
within a vb.net application?

G
I believe it shows up in the registry under the version. For example
if Access 2007 (12.0) is installed the following keys will be created:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess
HKEY_CURRENT_MACHINE\Software\Microsoft\Office\12. 0\Access

Thats about all I can think of.

Thanks,

Seth Rowe

Mar 2 '07 #2
On Fri, 2 Mar 2007 08:20:43 -0000, "G .Net" <no********@email.comwrote:

¤ Hi
¤
¤ How can I find which version of Access is installed on a computer from
¤ within a vb.net application?

You can use the FindExecutable API function, which operates by file association. You just need a
valid path to an Access .mdb file (it can be a dummy file as well).

Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As
String, _
ByVal lpDirectory As
String, _
ByVal lpResult As
System.Text.StringBuilder) As Int32

Function GetAccessVersion() As String

Dim DummyFile As String
Dim FileDir As String

Dim FilePath As New System.Text.StringBuilder(255)

DummyFile = "C:\Test Files\AccessXP.mdb"

If FindExecutable(DummyFile, FileDir, FilePath) 32 Then
Return
System.Diagnostics.FileVersionInfo.GetVersionInfo( FilePath.ToString).FileMajorPart()
End If

End Function
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 2 '07 #3
Hi Paul

Thanks for the suggestion. However I was more interested on knowing which
version(s) are on the client machine rather than the version type of a file.
Any ideas?

G

"Paul Clement" <Us***********************@swspectrum.comwrote in message
news:74********************************@4ax.com...
On Fri, 2 Mar 2007 08:20:43 -0000, "G .Net" <no********@email.comwrote:

¤ Hi
¤
¤ How can I find which version of Access is installed on a computer from
¤ within a vb.net application?

You can use the FindExecutable API function, which operates by file
association. You just need a
valid path to an Access .mdb file (it can be a dummy file as well).

Private Declare Function FindExecutable Lib "shell32.dll" Alias
"FindExecutableA" (ByVal lpFile As
String, _

ByVal lpDirectory As
String, _

ByVal lpResult As
System.Text.StringBuilder) As Int32

Function GetAccessVersion() As String

Dim DummyFile As String
Dim FileDir As String

Dim FilePath As New System.Text.StringBuilder(255)

DummyFile = "C:\Test Files\AccessXP.mdb"

If FindExecutable(DummyFile, FileDir, FilePath) 32 Then
Return
System.Diagnostics.FileVersionInfo.GetVersionInfo( FilePath.ToString).FileMajorPart()
End If

End Function
Paul
~~~~
Microsoft MVP (Visual Basic)

Mar 2 '07 #4
Hi again

Just to make it a little clearer what my intention is; in the application
I'm writing the client has to have Access 2003 so I'm intending to put a
warning message if it isn't installed on the client machine.

G

"Paul Clement" <Us***********************@swspectrum.comwrote in message
news:74********************************@4ax.com...
On Fri, 2 Mar 2007 08:20:43 -0000, "G .Net" <no********@email.comwrote:

¤ Hi
¤
¤ How can I find which version of Access is installed on a computer from
¤ within a vb.net application?

You can use the FindExecutable API function, which operates by file
association. You just need a
valid path to an Access .mdb file (it can be a dummy file as well).

Private Declare Function FindExecutable Lib "shell32.dll" Alias
"FindExecutableA" (ByVal lpFile As
String, _

ByVal lpDirectory As
String, _

ByVal lpResult As
System.Text.StringBuilder) As Int32

Function GetAccessVersion() As String

Dim DummyFile As String
Dim FileDir As String

Dim FilePath As New System.Text.StringBuilder(255)

DummyFile = "C:\Test Files\AccessXP.mdb"

If FindExecutable(DummyFile, FileDir, FilePath) 32 Then
Return
System.Diagnostics.FileVersionInfo.GetVersionInfo( FilePath.ToString).FileMajorPart()
End If

End Function
Paul
~~~~
Microsoft MVP (Visual Basic)

Mar 2 '07 #5
On Fri, 2 Mar 2007 15:13:01 -0000, "G .Net" <no********@email.comwrote:

¤ Hi again
¤
¤ Just to make it a little clearer what my intention is; in the application
¤ I'm writing the client has to have Access 2003 so I'm intending to put a
¤ warning message if it isn't installed on the client machine.

The major file version will correspond to a product version. For example, if Access 2003 is
installed then the code should return a major file version of 11.
Paul
~~~~
Microsoft MVP (Visual Basic)
Mar 2 '07 #6
G. Net

Are you sure you need the Access version. This is an office part and
versions you need for ineroperatability.

Most of us have used the Jet engine, which is/was free and is/was used in
Access as well.

Cor

"G .Net" <no********@email.comschreef in bericht
news:cO******************************@pipex.net...
Hi

How can I find which version of Access is installed on a computer from
within a vb.net application?

G

Mar 4 '07 #7
Hi Cor

I could generalise the question so that it isn't database specific e.g. how
can I find the version of Word on a client machine from code. I'd prefer not
to examine a file because that would mean implicitly creating one and then
testing it. Rather, I suspected, and an earlier post suggested that it could
be done via the registry?

G

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
G. Net

Are you sure you need the Access version. This is an office part and
versions you need for ineroperatability.

Most of us have used the Jet engine, which is/was free and is/was used in
Access as well.

Cor

"G .Net" <no********@email.comschreef in bericht
news:cO******************************@pipex.net...
>Hi

How can I find which version of Access is installed on a computer from
within a vb.net application?

G


Mar 4 '07 #8
I would do it by opening the application using OLE Automation and checking
the version information.

Try
xlApp = New Excel.Application()
MessageBox.Show("XL version is " & xlApp.Version)
Catch
MessageBox.Show("Excel is not installed, or I couldn't open it.")
Finally
xlApp.Close() 'I think it's close; it might be Quit
xlApp = Nothing
End Try

But feel free to muck around with the registry while you can. I think
that's a lot less likely to work in Vista with the clamped-down
permissions, although I haven't tried it yet.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-------------------------------------------------------------
"G .Net" <no********@email.comwrote in message
news:PZ******************************@pipex.net...
Hi Cor

I could generalise the question so that it isn't database specific e.g.
how can I find the version of Word on a client machine from code. I'd
prefer not to examine a file because that would mean implicitly creating
one and then testing it. Rather, I suspected, and an earlier post
suggested that it could be done via the registry?

G

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>G. Net

Are you sure you need the Access version. This is an office part and
versions you need for ineroperatability.

Most of us have used the Jet engine, which is/was free and is/was used
in Access as well.

Cor

"G .Net" <no********@email.comschreef in bericht
news:cO******************************@pipex.net.. .
>>Hi

How can I find which version of Access is installed on a computer from
within a vb.net application?

G



Mar 4 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Peter Frost | last post: by
33 posts views Thread by Uwe Range | last post: by
92 posts views Thread by Jeffrey P via AccessMonster.com | last post: by
reply views Thread by leo001 | last post: by

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.