Problemstellung:
Wie ermittle ich die auf meinem System installierte DAO-Versionen?
DAO 3.5 = A97
DAO 3.6 = A00-A03
DAO 12.0 = A07
Public Const sEngine As String = "DAO.DBEngine." Public Function DAOExist() As String '------------------------------------------------ ' Procedure : DAOExist ' DateTime : 29.01.2008 18:50 ' Author : TommyK '------------------------------------------------ Dim objTmp As Object Dim sResult As String Dim vDAOVersionList As Variant Dim vDAOTextList As Variant Dim i As Integer On Error Resume Next vDAOVersionList = Array("35", "36", "120") vDAOTextList = Array("DAO 3.5, ", "DAO 3.6, ", "DAO 12.0, ") For i = 0 To 2 Set objTmp = CreateObject(sEngine & vDAOVersionList(i)) If Err = 0 Then sResult = sResult & vDAOTextList(i) Err.Clear Next i If sResult = "" Then sResult = "Kein DAO installiert ..." Else sResult = Left(sResult, Len(sResult) - 2) End If Set objTmp = Nothing DAOExist = sResult End Function
Aufruf:
MsgBox DAOExist
Das Ergebnis:
Ähnliche Artikel
Weiterlesen...