Within the Access Application how do I return Jet Version Number for Jet Version 4 in the following format?
4.0.7328.0
Thanks, John
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)
I ran the Help VersionX Sub example as suggested and it returned the following:
Version of DBEngine (Microsoft Jet in memory) = 3.6
Version of the Microsoft Jet engine with which F:AppsAccess2kBuild.mdb was created = 4.0
Version of the Microsoft Jet engine with which F:AppsAccess2kBuildCnfbuild_be.mdb was created = 4.0
I
You will see the same difference even within the current database: in the Immediate window,
? DBEngine.Version
returns 3.6 – this is the version of DAO; compare the reference to the Microsoft DAO 3.6 Object Library; the major file is DAO360.dll (in C:Program FilesCommon FilesMicrosoft SharedDAO).
? CurrentDb.Version
returns 4.0 – this is the version of the Jet Engine; the major file is MSJet40.dll (in C:WindowsSystem32).
Here is code based on the API link Charlotte posted. It should go into a general module:
Private Type VS_FIXEDFILEINFO
dwSignature As Long
dwStrucVersionl As Integer
dwStrucVersionh As Integer
dwFileVersionMSl As Integer
dwFileVersionMSh As Integer
dwFileVersionLSl As Integer
dwFileVersionLSh As Integer
dwProductVersionMSl As Integer
dwProductVersionMSh As Integer
dwProductVersionLSl As Integer
dwProductVersionLSh As Integer
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type
Private Declare Function GetFileVersionInfo Lib “Version.dll” Alias “GetFileVersionInfoA” _
(ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Private Declare Function GetFileVersionInfoSize Lib “Version.dll” Alias “GetFileVersionInfoSizeA” _
(ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function VerQueryValue Lib “Version.dll” Alias “VerQueryValueA” _
(pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Sub MoveMemory Lib “kernel32” Alias “RtlMoveMemory” _
(dest As Any, ByVal Source As Long, ByVal length As Long)
Public Function VerInfo(FileName As String) As String
Dim rc As Long, lDummy As Long, sBuffer() As Byte
Dim lBufferLen As Long, lVerPointer As Long, udtVerBuffer As VS_FIXEDFILEINFO
Dim lVerbufferLen As Long
lBufferLen = GetFileVersionInfoSize(FileName, lDummy)
If lBufferLen < 1 Then
VerInfo = "No Version Info available!"
Exit Function
End If
ReDim sBuffer(lBufferLen)
rc = GetFileVersionInfo(FileName, 0&, lBufferLen, sBuffer(0))
rc = VerQueryValue(sBuffer(0), "", lVerPointer, lVerbufferLen)
MoveMemory udtVerBuffer, lVerPointer, Len(udtVerBuffer)
VerInfo = Format$(udtVerBuffer.dwFileVersionMSh) & "." & _
Format$(udtVerBuffer.dwFileVersionMSl) & "." & _
Format$(udtVerBuffer.dwFileVersionLSh) & "." & _
Format$(udtVerBuffer.dwFileVersionLSl)
End Function
You can use this in the control source of a text box:
=”Jet version ” & VerInfo(“C:WindowsSystem32MSJet40.dll”)
Note: this assumes Windows 2000/XP. In Windows NT, the path will be C:WinNTWindows 32.
Here is code based on the API link Charlotte posted. It should go into a general module:
Private Type VS_FIXEDFILEINFO
dwSignature As Long
dwStrucVersionl As Integer
dwStrucVersionh As Integer
dwFileVersionMSl As Integer
dwFileVersionMSh As Integer
dwFileVersionLSl As Integer
dwFileVersionLSh As Integer
dwProductVersionMSl As Integer
dwProductVersionMSh As Integer
dwProductVersionLSl As Integer
dwProductVersionLSh As Integer
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type
Private Declare Function GetFileVersionInfo Lib “Version.dll” Alias “GetFileVersionInfoA” _
(ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Private Declare Function GetFileVersionInfoSize Lib “Version.dll” Alias “GetFileVersionInfoSizeA” _
(ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function VerQueryValue Lib “Version.dll” Alias “VerQueryValueA” _
(pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Sub MoveMemory Lib “kernel32” Alias “RtlMoveMemory” _
(dest As Any, ByVal Source As Long, ByVal length As Long)
Public Function VerInfo(FileName As String) As String
Dim rc As Long, lDummy As Long, sBuffer() As Byte
Dim lBufferLen As Long, lVerPointer As Long, udtVerBuffer As VS_FIXEDFILEINFO
Dim lVerbufferLen As Long
lBufferLen = GetFileVersionInfoSize(FileName, lDummy)
If lBufferLen < 1 Then
VerInfo = "No Version Info available!"
Exit Function
End If
ReDim sBuffer(lBufferLen)
rc = GetFileVersionInfo(FileName, 0&, lBufferLen, sBuffer(0))
rc = VerQueryValue(sBuffer(0), "", lVerPointer, lVerbufferLen)
MoveMemory udtVerBuffer, lVerPointer, Len(udtVerBuffer)
VerInfo = Format$(udtVerBuffer.dwFileVersionMSh) & "." & _
Format$(udtVerBuffer.dwFileVersionMSl) & "." & _
Format$(udtVerBuffer.dwFileVersionLSh) & "." & _
Format$(udtVerBuffer.dwFileVersionLSl)
End Function
You can use this in the control source of a text box:
=”Jet version ” & VerInfo(“C:WindowsSystem32MSJet40.dll”)
Note: this assumes Windows 2000/XP. In Windows NT, the path will be C:WinNTWindows 32.
You will see the same difference even within the current database: in the Immediate window,
? DBEngine.Version
returns 3.6 – this is the version of DAO; compare the reference to the Microsoft DAO 3.6 Object Library; the major file is DAO360.dll (in C:Program FilesCommon FilesMicrosoft SharedDAO).
? CurrentDb.Version
returns 4.0 – this is the version of the Jet Engine; the major file is MSJet40.dll (in C:WindowsSystem32).
If you want the specific version number for Msjet40.dll or any other system file for which version is available, you can use the Windows GetFileVersionInfo API function, which uses the somewhat complex VS_FIXEDFILEINFO structure to return detailed information concerning the specified file. If interested, see attached text file (exported code module). To use this, rename file as basVersionInfo.bas and import into your project. Run sub named DisplayDLLVersionInfo – provide file name as argument, the procedure by default uses the Windows system directory (determined by GetSystemDirectory API function) as path. (If testing non-system file, modify sub accordingly – the Jet DLL is located in system directory.) If you take a look at the attached file you will see it is not a simple task to reliably ascertain version info – a typically convoluted Windows procedure. Code was adapted from the following MSKB article:
How to Use Functions in VERSION.DLL — A 32-bit Sample App
See next post for test results (only one attachment allowed per post…)
HTH
In further reply, here are test results on my system (WIN XP, ACC 2002):
DisplayDLLVersionInfo “Msjet40.dll”
C:WINDOWSSystem32Msjet40.dll
File Version: 4.0.7328.0
Product Version: 4.0.7328.0
File OS: NT-Win32
File Type: DLL
File Subtype:
This version info is same as seen when you right-click actual file and open Properties dialog “Version” tab – see attached pic.
You probably know how to check the Jet DLL version number to determine which SP is installed, but anyway for the record here is link to MSKB Article:
How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine
HTH
No, this information is not stored in Windows Registry, it is stored in the file itself. Windows uses version stamping in DLL’s and other program files so that installation programs have a way to determine what version of a DLL or other file is the latest. A DLL that supports version stamping contains a version resource, which includes the VS_FIXEDFILEINFO data structure used by the GetFileVersionInfo API function:
Type VS_FIXEDFILEINFO
dwSignature As Long
dwStrucVersionl As Integer
dwStrucVersionh As Integer
dwFileVersionMSl As Integer ‘ Most significant 32 bits – low 16 bits – minor revision number
dwFileVersionMSh As Integer ‘ Most significant 32 bits – high 16 bits – major revision number
dwFileVersionLSl As Integer ‘ Least significant 32 bits – low 16 bits
dwFileVersionLSh As Integer ‘ Least significant 32 bits – high 16 bits
dwProductVersionMSl As Integer
dwProductVersionMSh As Integer
dwProductVersionLSl As Integer
dwProductVersionLSh As Integer
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type
Note that the file version number is 64 bits long, though usually only the most significant 32 bits are used, as commented above. Using the numbers derived from this data structure is considered the most reliable way to ascertain the correct version number of a version stamped file.
HTH
No, this information is not stored in Windows Registry, it is stored in the file itself. Windows uses version stamping in DLL’s and other program files so that installation programs have a way to determine what version of a DLL or other file is the latest. A DLL that supports version stamping contains a version resource, which includes the VS_FIXEDFILEINFO data structure used by the GetFileVersionInfo API function:
Type VS_FIXEDFILEINFO
dwSignature As Long
dwStrucVersionl As Integer
dwStrucVersionh As Integer
dwFileVersionMSl As Integer ‘ Most significant 32 bits – low 16 bits – minor revision number
dwFileVersionMSh As Integer ‘ Most significant 32 bits – high 16 bits – major revision number
dwFileVersionLSl As Integer ‘ Least significant 32 bits – low 16 bits
dwFileVersionLSh As Integer ‘ Least significant 32 bits – high 16 bits
dwProductVersionMSl As Integer
dwProductVersionMSh As Integer
dwProductVersionLSl As Integer
dwProductVersionLSh As Integer
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type
Note that the file version number is 64 bits long, though usually only the most significant 32 bits are used, as commented above. Using the numbers derived from this data structure is considered the most reliable way to ascertain the correct version number of a version stamped file.
HTH
In further reply, here are test results on my system (WIN XP, ACC 2002):
DisplayDLLVersionInfo “Msjet40.dll”
C:WINDOWSSystem32Msjet40.dll
File Version: 4.0.7328.0
Product Version: 4.0.7328.0
File OS: NT-Win32
File Type: DLL
File Subtype:
This version info is same as seen when you right-click actual file and open Properties dialog “Version” tab – see attached pic.
You probably know how to check the Jet DLL version number to determine which SP is installed, but anyway for the record here is link to MSKB Article:
How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine
HTH
If you want the specific version number for Msjet40.dll or any other system file for which version is available, you can use the Windows GetFileVersionInfo API function, which uses the somewhat complex VS_FIXEDFILEINFO structure to return detailed information concerning the specified file. If interested, see attached text file (exported code module). To use this, rename file as basVersionInfo.bas and import into your project. Run sub named DisplayDLLVersionInfo – provide file name as argument, the procedure by default uses the Windows system directory (determined by GetSystemDirectory API function) as path. (If testing non-system file, modify sub accordingly – the Jet DLL is located in system directory.) If you take a look at the attached file you will see it is not a simple task to reliably ascertain version info – a typically convoluted Windows procedure. Code was adapted from the following MSKB article:
How to Use Functions in VERSION.DLL — A 32-bit Sample App
See next post for test results (only one attachment allowed per post…)
HTH
I ran the Help VersionX Sub example as suggested and it returned the following:
Version of DBEngine (Microsoft Jet in memory) = 3.6
Version of the Microsoft Jet engine with which F:AppsAccess2kBuild.mdb was created = 4.0
Version of the Microsoft Jet engine with which F:AppsAccess2kBuildCnfbuild_be.mdb was created = 4.0
I
This will have to be adapted… but check out this link…
http://www.granite.ab.ca/access/verifyjetsp.htm%5B/url%5D
Hopefully it’s a start for you anyway…
This will have to be adapted… but check out this link…
http://www.granite.ab.ca/access/verifyjetsp.htm%5B/url%5D
Hopefully it’s a start for you anyway…
The API will return a full version string for a file. Check out All-API.Net GetFileVersionInfo for instructions and sample code.
The API will return a full version string for a file. Check out All-API.Net GetFileVersionInfo for instructions and sample code.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications