Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    UT227 is offline Competent Performer
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    484

    That link worked for me. Thanks. I'm sure this is a stupid question, but how do I increase the version so it knows to update it?

  2. #17
    Gicu's Avatar
    Gicu is offline Expert
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    962
    You need to copy the usysVersion table into the front-end. To see it go to File/Options/Current Dtaabase/Navigation and turn on (check) system objects. Usually I create a form (frmVersion is included in the launcher) that I embed in a switchboard of some sort that stays open so the user knows what version they have (I also put the version number and revision date in the application title).
    You can PM me if you need more help.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #18
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,984
    This may not be relevant as you are using Vlad's updater but my own updater checks three things in the local and network copies
    1. The version number in a version.txt file
    2. The version number in a local settings table in the FE
    3. The date modified of the program file.

    If any of those indicate the network file is newer, the update runs.
    I also use Windows API to manage file copying as it is far faster and, if necessary, can be paused or cancelled.
    See this post from earlier todayhttps://www.access-programmers.co.uk...3&postcount=18
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  4. #19
    Gicu's Avatar
    Gicu is offline Expert
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    962
    Yes Colin , I also use Windows APis for the file copying:
    Code:
    Option Compare Database
    
    
    Option Explicit
    Const FO_COPY = &H2
    Const FO_DELETE = &H3
    Const FO_MOVE = &H1
    Const FO_RENAME = &H4
    Const FOF_ALLOWUNDO = &H40
    Const FOF_SILENT = &H4
    Const FOF_NOCONFIRMATION = &H10
    Const FOF_RENAMEONCOLLISION = &H8
    Const FOF_NOCONFIRMMKDIR = &H200
    Const FOF_FILESONLY = &H80
    
    
    Private Type SHFILEOPSTRUCT
        hwnd      As Long
        wFunc     As Long
        pFrom     As String
        pTo       As String
        fFlags    As Integer
        fAborted  As Boolean
        hNameMaps As Long
        sProgress As String
    End Type
    
    
    #If VBA7 And Win64 Then
        'x64 Declarations
        Private Declare PtrSafe Function SHFileOperation Lib "shell32.dll" _
            Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
    #Else
        'x32 Declaration
        Private Declare Function SHFileOperation Lib "shell32.dll" _
            Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
    #End If
        
    Public Function vcCopyFIle(sSource As String, sDest As String)
    Dim lFileOp  As Long
    Dim lresult  As Long
    Dim lFlags   As Long
    Dim SHFileOp As SHFILEOPSTRUCT
    lFileOp = FO_COPY
    lFlags = lFlags Or FOF_NOCONFIRMATION
    lFlags = lFlags Or FOF_SILENT
    With SHFileOp
        .wFunc = lFileOp
        .pFrom = sSource & vbNullChar & vbNullChar
        .pTo = sDest & vbNullChar & vbNullChar
        .fFlags = lFlags
    End With
    lresult = SHFileOperation(SHFileOp)
    
    
    End Function
    I can see the first two options being safe but wouldn't the third (date modified) be a bit of a liability in case some one opens/ modifies the network version by mistake?
    Also just curious if yours keeps a copy of the local file in case the user modified any objects (mainly queries) that could be imported into the newer version?

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #20
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,984
    Hi Vlad
    Sorry. Only just read your reply.

    That's similar API code to 'mine' (probably both taken from the same source) but two points regarding your conditional compilation (CC)
    1. You also need to apply CC to the 2 pointers in the Type part of the declaration
    2. There is no need to use Win64. VBA7 covers both bitnesses in A2010 or later
    In fact if all users, have a minimum of A2010, just use the VBA7 version of the CC

    My version of the code is in the link in post #18

    Regarding the date modified check, I instruct my clients to keep the upgrade folder locked down on the server so only the program admins have access to it.
    Also to ensure files in that folder are NEVER opened directly from that location.
    I've used the system since 2005 with multiple clients without any issues.
    However, that check could just be omitted if not appropriate for any reason.
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  6. #21
    Gicu's Avatar
    Gicu is offline Expert
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    962
    Thanks Colin, I just made the change to include the Type pointers (as LongPtr for 64 bit) yesterday...

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Compact & Repair
    By Kundan in forum Programming
    Replies: 2
    Last Post: 01-31-2019, 01:19 AM
  2. Compact & Repair
    By Kundan in forum Programming
    Replies: 2
    Last Post: 01-13-2019, 10:24 PM
  3. Compact and Repair
    By cwitt11 in forum Access
    Replies: 4
    Last Post: 12-08-2015, 11:52 AM
  4. Compact and repair
    By data808 in forum Access
    Replies: 4
    Last Post: 03-30-2014, 03:22 AM
  5. Compact and Repair
    By Cyberice in forum Access
    Replies: 3
    Last Post: 03-18-2014, 03:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums