Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    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

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    The version property for DAO should return that for you if you specify the database as the object, at least in 2002. Search the VBA help for version and you should find an example of how to do that.
    Wendell

  3. #3
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    This will have to be adapted... but check out this link...
    http://www.granite.ab.ca/access/verifyjetsp.htm

    Hopefully it's a start for you anyway... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 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

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    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).

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    The API will return a full version string for a file. Check out All-API.Net GetFileVersionInfo for instructions and sample code.
    Charlotte

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hans

    Thanks for the info

    After working with the forum for a year, when expressing a problem, many of the responses say to check service pack of access and Jet, etc.

    What I

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Here is code based on the API link Charlotte posted. It should go into a general module:

    <img src=/w3timages/blueline.gif width=33% height=2>

    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

    <img src=/w3timages/blueline.gif width=33% height=2>

    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.

  9. #9
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    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
    Attached Files Attached Files

  10. #10
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    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
    Attached Images Attached Images

  11. #11
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Thanks to all that replied

    MarkD, I like your code because it looks like it is not hard coded, where does it get version info? registry?

    Thanks, John

  12. #12
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: How to Return Jet Version Number? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •