powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Возможно ли программное определение версии Акцесса?
9 сообщений из 9, страница 1 из 1
Возможно ли программное определение версии Акцесса?
    #32216640
Фотография Joss
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Иногда бывает необходимо знать версию Акцесса (97, 2000 или 2002), чтобы решить, кокую функцию использовать в процессе работы. Одни работают в одной версии, но не работают в другой. У пользователей на машинах настоящий винегрет. Они бывает сами ставят себе новые версии Офиса, а потом возмущаются, что база не работает. Вести парралельно три версии под три офиса ломота. Можно легко пропустить изменение. Лучше одну версию, но с ветлением по версиям офиса. Можно ли программно определить версию установленного офиса? Особый прикол, это когда несколько офисов на машине и база может быть запущена под любым из них.
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216642
Hummer
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ну как вариант - анализировать ветки реестра с записями об офисе.
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216654
Хам трамвайный
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Application.Version

по-моему в 97 не работает
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216667
Фотография Лох Позорный
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Одни работают в одной версии, но не работают в другой
Ну так и не используй такие функции. Все равно компилироваться не будет с ними.
Хотя это и бред - делай ОДНУ программу под ТРИ разные версии офиса одновременно.

Если пользователи сами себе офис устанавливают какой захотят - ну пусть тогда сами себе и программы пишут. Какие захотят.
В нормальных фирмах есть такое понятие, как корпоративный стандарт на программное обеспечение.

Разруха - она в головах (с) собачье сердце
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216808
som
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
som
Гость
В 97 работает DBEngine.Version - версия DAO, если это поможет. 3.5(1) - 97, 3.6(?) - 2002, 2000 - не знаю, проверь.
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216834
Фотография TatianaT
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
2000 тоже 3,6 :)
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32216841
som
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
som
Гость
Жаль :)
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32217447
Фотография Joss
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Вот такое сообщение мне кинули с форума на http://am.rusimport.ru
автор АлексейЕ
******************************************************
Уж не помню где взял.
Вопрос: Получите Версию Офиса

Совет:
Get Version of Office Exes (detecting Office 2000 SR1 patch)
--------------------------------------------------------------------------------
Microsoft hasn't provided any way for us to programmatically detect whether a particular patch (like Office Service Packs) is installed or not.

One workaround this limitation is to read off the version information stored in the actual Office executables themselves. The following table lists the version information retrieved by running this code on one of my and one of Doug Ware's system.


Exe Name Pre Office Post Office
2000 SR1 2000 SR1
--------------------------------------------------------------------------
MsAccess.exe 9.0.0.2719 9.0.0.3822
WinWord.exe 9.0.0.2717 9.0.0.3822
Excel.Exe 9.0.0.2719 9.0.0.3822
FrontPage.exe 4.0.2.2717 4.0.2.3821
Outlook.exe 9.0.0.2416 9.0.0.2416
PowerPnt.exe 9.0.0.2716 9.0.0.3821
WinProj.exe 8.0.98.407 Build not available


==============


' ******** Code Start ********
' structure contains version information about a file. This
' information is language and code page independent.
Private Type VS_FIXEDFILEINFO
' Contains the value 0xFEEFO4BD (szKey)
dwSignature As Long
' Specifies the binary version number of this structure.
dwStrucVersion As Long
' most significant 32 bits of the file's binary version number.
dwFileVersionMS As Long
' least significant 32 bits of the file's binary version number.
dwFileVersionLS As Long
' most significant 32 bits of the binary version number of
' the product with which this file was distributed
dwProductVersionLS As Long
' least significant 32 bits of the binary version number of
' the product with which this file was distributed
dwFileFlagsMask As Long
' Contains a bitmask that specifies the valid bits in dwFileFlags.
dwProductVersionMS As Long
' Contains a bitmask that specifies the
' Boolean attributes of the file.
dwFileFlags As Long
' operating system for which this file was designed.
dwFileOS As Long
' general type of file.
dwFileType As Long
' function of the file.
dwFileSubtype As Long
' most significant 32 bits of the file's 64-bit
' binary creation date and time stamp.
dwFileDateMS As Long
' least significant 32 bits of the file's 64-bit binary
' creation date and time stamp.
dwFileDateLS As Long
End Type

' Returns size of version info in Bytes
Private Declare Function apiGetFileVersionInfoSize _
Lib "version.dll" Alias "GetFileVersionInfoSizeA" _
(ByVal lptstrFilename As String, _
lpdwHandle As Long) _
As Long

' Read version info into buffer
' /* Length of buffer for info *
' /* Information from GetFileVersionSize *
' /* Filename of version stamped file *
Private Declare Function apiGetFileVersionInfo Lib _
"version.dll" Alias "GetFileVersionInfoA" _
(ByVal lptstrFilename As String, _
ByVal dwHandle As Long, _
ByVal dwLen As Long, _
lpData As Any) _
As Long

' returns selected version information from the specified
' version-information resource.
Private Declare Function apiVerQueryValue Lib _
"version.dll" Alias "VerQueryValueA" _
(pBlock As Any, _
ByVal lpSubBlock As String, _
lplpBuffer As Long, _
puLen As Long) _
As Long

Private Declare Sub sapiCopyMem _
Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, _
Source As Any, _
ByVal Length As Long)

Function fGetProductVersion(strExeFullPath As String) As String
'
' Returns the build number for Office exes
'
' Sample usage (Access 2000)
' ?fGetProductVersion(SysCmd(acSysCmdAccessDir) & "Frontpg.exe") '
' Product Pre-SR1 Post-SR1
' ----------------------------------------------------------------------------------
' MSAccess.exe 9.0.0.2719 9.0.0.3822
' WinWord.exe 9.0.0.2717 9.0.0.3822
' Excel.exe 9.0.0.2719 9.0.0.3822
' FrontPg.exe 4.0.2.2717 4.0.2.3821
' Outlook.exe 9.0.0.2416 9.0.0.2416
' PowerPnt.exe 9.0.0.2716 9.0.0.3821
' WinProj.exe 8.0.98.407 Don't have it, sorry.
'
On Error GoTo ErrHandler
Dim lngSize As Long
Dim lngRet As Long
Dim pBlock() As Byte
Dim lpfi As VS_FIXEDFILEINFO
Dim lppBlock As Long

' GetFileVersionInfo requires us to get the size
' of the file version information first, this info is in the format
' of VS_FIXEDFILEINFO struct
lngSize = apiGetFileVersionInfoSize( _
strExeFullPath, _
lngRet)

' If the OS can obtain version info, then proceed on
If lngSize Then
' the info in pBlock is always in Unicode format
ReDim pBlock(lngSize)
lngRet = apiGetFileVersionInfo(strExeFullPath, 0, _
lngSize, pBlock(0))
If Not lngRet = 0 Then
' the same pointer to pBlock can be passed to VerQueryValue
lngRet = apiVerQueryValue(pBlock(0), _
"\", lppBlock, lngSize)

' fill the VS_FIXEDFILEINFO struct with bytes from pBlock
' VerQueryValue fills lngSize with the length of the block.
Call sapiCopyMem(lpfi, ByVal lppBlock, lngSize)
' build the version info strings
With lpfi
fGetProductVersion = HIWord(.dwFileVersionMS) & "." & _
LOWord(.dwFileVersionMS) & "." & _
HIWord(.dwFileVersionLS) & "." & _
LOWord(.dwFileVersionLS)
End With
End If
End If

ExitHere:
Erase pBlock
Exit Function
ErrHandler:
Resume ExitHere
End Function

Private Function LOWord(dw As Long) As Integer
' retrieves the low-order word from the given 32-bit value.
If dw And &H8000& Then
LOWord = dw Or &HFFFF0000
Else
LOWord = dw And &HFFFF&
End If
End Function

Private Function HIWord(dw As Long) As Integer
' retrieves the high-order word from the given 32-bit value.
HIWord = (dw And &HFFFF0000) \ &H10000
End Function
' ******** Code End *********
...
Рейтинг: 0 / 0
Возможно ли программное определение версии Акцесса?
    #32217467
Фотография Joss
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
А вот ещё одно сообщение с форума am.rusimport.ru от Анатолия(Киев)

?SysCmd(acSysCmdAccessVer)
8.0 - А97
9.0 - А2000
10.0 - А2002
Эта же функция может вернуть путь к MSAccess.exe и много чего еще.
...
Рейтинг: 0 / 0
9 сообщений из 9, страница 1 из 1
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Возможно ли программное определение версии Акцесса?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]