|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Installed version of AccessIs it possible to check what version of Acess is running / installed on a
computer from vb.net? reidarT Try to lookup
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mdb default registry value HTH Show quoteHide quote "reidarT" wrote: > Is it possible to check what version of Acess is running / installed on a > computer from vb.net? > reidarT > > > ' Imports
Imports Microsoft.win32 Imports System.IO ' Add two Buttons & a TextBox to use this code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Not GetAccessVersion() = "" Then Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo(GetAccessVersion()) TextBox1.Text = fvi.ProductMajorPart.ToString Else MessageBox.Show("Unable to get MS Access Version", "Error", _ MessageBoxButtons.OK, MessageBoxIcon.Error) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Application.Exit() End Sub ' Function to get Access path Private Function GetAccessVersion() As String Dim reg As RegistryKey Dim strPath As String = "" Try reg = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\ App Paths\msaccess.exe", False) strPath = reg.GetValue("") Return strPath Catch ex As Exception Return "" Finally If Not reg Is Nothing Then reg.Close() End Try End Function ' That's it ' I have included the project with this post ' I hope this helps ' Newbie Coder [attached file: Get MS Access Version.zip]
what is a static property and a cursor question
Why is this simple addition throwing an overflow exception? Delete Directory not working Create Serial Number Data entry into ComboBox VS 2005 baffled at step 1 Problem saving txt box with enter key How to run and communicate a DOS program file in a VB.NET program? Can someone please translate this to VB.Net WIALib error |
|||||||||||||||||||||||