S
SimeonD
I'm a bit confused. Why does the version of the ADP or mdb matter?
Is it not just the version of office?
There is come code I use below, which determines the version of Access. Its
VB 2005 though.
Not sure if its any use, but its along the lines of what Doug was saying.
Its from a project I had last year, to open an Access ADP from a third party
app. The idea was to open frmClient in Access, looking at a the same client
that was on screen in the third party app.
As far as I remember, my main problems were: (1) Determing if only access
runtime was available. (2) Finding out if the Access app was already open.
'********************************************************
' Get the nice style of the Access version name.
Public Function GetAccessVersionNiceName() As String
Try
Select Case GetAccessVersionNumber()
Case 8
Return "Access 97"
Case 9
Return "Access 2000"
Case 10
Return "Access XP"
Case 11
Return "Access 2003"
Case 12
Return "Access 2007"
Case Else
Return "unknown"
End Select
Catch ex As Exception
Return "unknown"
End Try
End Function
' Determine the Access version by creating an
' Access.Application object and looking at
' its Version property.
Private Function GetAccessVersionName() As String
Dim obj As Object = CreateObject("Access.Application")
Dim result As String = "Access.Application." & _
obj.Version
obj.Quit()
Return result
End Function
' Get the Access version number from the name.
Private Function GetAccessVersionNumber() As Integer
Dim txt As String = GetAccessVersionName()
Dim pos2 As Integer = txt.LastIndexOf(".")
Dim pos1 As Integer = txt.LastIndexOf(".", pos2 - 1)
txt = txt.Substring(pos1 + 1, pos2 - pos1 - 1)
Return CInt(txt)
End Function
Is it not just the version of office?
There is come code I use below, which determines the version of Access. Its
VB 2005 though.
Not sure if its any use, but its along the lines of what Doug was saying.
Its from a project I had last year, to open an Access ADP from a third party
app. The idea was to open frmClient in Access, looking at a the same client
that was on screen in the third party app.
As far as I remember, my main problems were: (1) Determing if only access
runtime was available. (2) Finding out if the Access app was already open.
'********************************************************
' Get the nice style of the Access version name.
Public Function GetAccessVersionNiceName() As String
Try
Select Case GetAccessVersionNumber()
Case 8
Return "Access 97"
Case 9
Return "Access 2000"
Case 10
Return "Access XP"
Case 11
Return "Access 2003"
Case 12
Return "Access 2007"
Case Else
Return "unknown"
End Select
Catch ex As Exception
Return "unknown"
End Try
End Function
' Determine the Access version by creating an
' Access.Application object and looking at
' its Version property.
Private Function GetAccessVersionName() As String
Dim obj As Object = CreateObject("Access.Application")
Dim result As String = "Access.Application." & _
obj.Version
obj.Quit()
Return result
End Function
' Get the Access version number from the name.
Private Function GetAccessVersionNumber() As Integer
Dim txt As String = GetAccessVersionName()
Dim pos2 As Integer = txt.LastIndexOf(".")
Dim pos1 As Integer = txt.LastIndexOf(".", pos2 - 1)
txt = txt.Substring(pos1 + 1, pos2 - pos1 - 1)
Return CInt(txt)
End Function