Q: Which Access version

  • Thread starter Thread starter G .Net
  • Start date Start date
G

G .Net

Hi

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

G
 
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\Access
HKEY_CURRENT_MACHINE\Software\Microsoft\Office\12.0\Access

Thats about all I can think of.

Thanks,

Seth Rowe
 
¤ 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)
 
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
 
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
 
¤ 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)
 
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
 
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
 
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.
 
Back
Top