Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB7
Expertise: Intermediate
Jul 28, 2003



Application Security Testing: An Integral Part of DevOps

GetMdacVersion - Retrieve the installed MDAC version

' Retrieve the installed MDAC version
' Examples:
'   Dim ver As Version = GetMdacVersion()
'   ' print the full version
'   MessageBox.Show(ver.ToString())
'   ' print the major and minor portions
'   MessageBox.Show("Major: " & ver.Major & ", Minor: " & ver.Minor)
'   ' check whether the current version is at least 2.7
'   If ver.CompareTo(New Version(2, 7, 0, 0)) < 0 Then
'      MessageBox.Show("MDAC version 2.7 or above is required!")
'   End If

Function GetMdacVersion() As Version
    ' get the value of the FullInstallVer value under the HKLM\SOFTWARE\
    ' Microsoft\DataAccess key
    Dim regKey As Microsoft.Win32.RegistryKey = _
        Microsoft.Win32.Registry.LocalMachine.OpenSubKey( _
    Dim ver As String = CType(regKey.GetValue("FullInstallVer", ""), _
    ' split the string in tokens and build a Version object
    Dim verTokens() As String = ver.Split("."c)
    Return New Version( Integer.Parse(verTokens(0)), Integer.Parse(verTokens(1)) _
        , Integer.Parse(verTokens(2)), Integer.Parse(verTokens(3)))
End Function
Marco Bellinaso
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date