Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038

    Push (copy) updated Front-end FE from server to client machine -- using AutoUpdater

    Experts:

    I would like to get some assistance with "pushing" a modified Access frontend (FE) from a LAN to client machines using "AutoUpdater" (posted on http://www.utteraccess.com/forum/Eas...r-t304808.html).

    Please note that I previously opened similar thread related to this topic. Several experts recommended a different utility tool vs. AutoUpdater. I was totally open to trying out the alternate utility tools. Although all experts were extremly patient and provided continued assistance over the Thanksgiving weekend, I ultimately was never able to get the process to work (post had nearly 50 back-and-forth responses).

    So, at this time, the focus on this new (re-focused) thread is to assist me w/ modifying AutoUpdater. However, if someone were to provide a **fully functioning** utility tool which allows me to push a modified FE to a client machine, I certainly would consider that one, too.

    Please find attached .ZIP file containing "AutoUpdater"... allow me to provide some background and setup instructions first though.

    Background:
    - Attached .zip includes folder "Test" and two subfolders: "01_Server" and "02_Client"
    - Subfolder "01_Server" includes two Access files: "Database_be" and "Database_fe". These databases are for testing the "pushing" server FE to the client machine only. Thus, the data in table "T_Branches" are dummy data and of no importance.
    - Subfolder "02_Client" includes two Access files: "AutoUpdater" and "Database_fe".

    Setup for Database_fe (in 01_Server):
    1. Go to subfolder "01_Server" and open "Database_fe".
    2. Delete linked table "T_Branches".
    3. Now, re-link "T_Branches" via Linked Table Manager. Point to Database_be (01_Server) during the re-linking process.
    4. FYI... please note this version of "Database_fe" includes 1 query object, 1 form object, 1 reports objects. Also, please note the value of "2" in tblLocalVariables.

    Setup for Database_fe (in 02_Client):
    1. Go to subfolder "02_Client" and open "Database_fe".
    2. Delete linked table "T_Branches".
    3. Now, re-link "T_Branches" via Linked Table Manager. Point to Database_be (01_Server) during the re-linking process.
    4. FYI... please note this version of "Database_fe" does **NOT** include any query, form or report object. Also, please note the value of "1" in tblLocalVariables. Thus, missing the query, form, and report objects, it mimics an out-of-date FE version.

    Setup for "AutoUpdater" (in 02_Client):
    1. Go to subfolder "02_Client".
    2. Press and hold "Shift" key; then open "AutoUpdater".
    3. Delete linked table "tblLocalVariables".
    4. Now, re-link "tblLocalVariables" via Linked Table Manager. Point to Database_fe (01_Server) during the re-linking process. Again, this is the FRONTEND on the server.
    5. Finally, open up "frmSetup". In the first two (2) text boxes, select the FEs from both server and client, respectively. In the 3rd file path, please select your Access application or shortcut to Access. Then "Saves Changes".


    6. In the last two (2) boxes you should see a "2" for the server FE and a "1" for the client FE.
    7. Close "AutoUpdater".

    Envisioned process:
    - In a hypothetical scenario, the FE on the server has been modified. In this example, it is version "2" in tblLocalVariables.
    - At the same time, the user/client still has the old FE (i.e., version "1" in tblLocalVariables).
    - AutoUpdate shall "push" (or "pull") the modified FE version from server to client machine.
    - Later on, I will rename "AutoLoader" (or its shortcut) with my actual database's name. If so, the database user "believes" he opens the actual client database but in reality open the AutoUpdater utility first.
    - AutoUpdater will then check whether or not there's a newer version of the FE on the server. In this case, the answer is yes. Thus, client FE (v1) will be replaced with server FE (v2).
    - Whether or not a newer FE was downloaded from the server, I then want AutoUpdater to invoke the process of opening up the "real" client database (i.e., Database_fe on client). So, ultimately, even though the user started by opening AutoUpdater (unbeknownst to them), they end up with the actual database being opened.

    Existing issues:
    - At this time, I get an error message "Invalid Procedure call or argument" after the FE has been downloaded. If both versions were the same, I get this error immediately. How can I fix this error?
    - Also, the Database_fe on client is not opened by AutoUpdater. How should the code be modified to accomplish this?

    Ultimate goal:
    - User has both FE and AutoUpdater on client machine.
    - System administrator makes a change to FE on server.
    - User opens AutoUpdater (w/ renamed shortcut to mimic as if it's client FE). AutoUpdater utility compares both FE versions.
    - If FE versions are the same, FE on client opened is opened by AutoUpdater. If FE versions are different, server is FE is download to client and then AutoUpdater opens the latest client FE.

    Again, at this time in have two (2) existing issues that require modification.

    Thank you in advance,
    EEH
    Attached Thumbnails Attached Thumbnails Error.JPG  
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Wow, blast from the past to see my name in there! I don't think I ever used a table for the variables, but strings. Use Debug.Print to see how yours are coming out. My old code looks like:

    strRunPath = g_sRunPath & " " & strUserPath
    Call Shell(strRunPath, 1)

    You'd want to find out how

    Chr(34) & strAccessLocOnClient & Chr(34) & " " & Chr(34) & strClientLocation & Chr(34)

    is being resolved.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Have a look at my free fe updater, I believe it does exactly what you describe: http://forestbyte.com/ms-access-util...a-db-launcher/.
    Cheers,
    Vlad

  4. #4
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul:

    Wow, that's interesting... truly a blast from the past.

    Anyhow, I'm not entire familiar w/ the Debug process. I opened the module basVersionCheck and then opened an immediate window. Typed into code (see attached JPG) and then pressed ENTER.
    As a result, another error box popped up. Again, included are two JPG illustrating current status. Not sure how where to go from here...
    If VBA can/should be recoded, I'm all for it... not sure where to begin though.

    *******************

    Gicu -- I will give it a try. I just hope it's not like the two other "solutions" (offered in another post). Those solutions required multiple changes and I was never able to follow the setup/configuration process.
    So, again, I hope your version is a "plug-n-play" vs. "plug-n-pray".

    Thanks,
    Tom
    Attached Thumbnails Attached Thumbnails Debug.JPG   Debug -- Error Dialogue.JPG  

  5. #5
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Gicu:

    Thank you... I downloaded your DB and once again I was **NOT** successful executing it.

    Here's what I did:
    - Just like in the original example, I created a folder with two subfolders (one mimicking the LAN; the 2nd one mimicking the client folder)
    - Opened your db and completed the form.
    - I could NOT uncheck the "Same Folder" checkbox; I could NOT check the "Auto Run".
    - So, I'm lost as to what should have happened here.

    When I reopend your database, all information in the form was lost. I'm sure this version is working for you perfectly. Would it be too much to ask if you install your database with your in the folder structure that I included in my original post. I may have to update the path but at least I may be able to follow your logic.

    Thanks,
    Tom
    Attached Thumbnails Attached Thumbnails Capture.JPG  

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The Debug.Print would be in your code, the result in the Immediate window:

    http://www.baldyweb.com/ImmediateWindow.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul:

    Extremely useful link... I have bookmarked it. Thanks!

    Here's what I've done:
    - Added the following line of code into module basVersionCheck: Debug.Print Chr(34) & strAccessLocOnClient & Chr(34) & " " & Chr(34) & strClientLocation & Chr(34)
    - Clicked on green triangle (toolbar) to execute the code
    - Now, in the immediate window, I get the following error: "C:\Users\thomas.bock1\AppData\Roaming\Microsoft\I nternet Explorer\Quick Launch\User Pinned\TaskBar\Access 2016 (2).lnk" "C:\Users\thomas.bock1\Desktop\LocalCopy\Database_ fe.accdb"

    So, I'm still not sure exactly what's causing it:
    - Per the frmSetup, I believe I followed the author's instructions.
    - Now, for the 3rd text box ("Location of ACCESS on your CLIENT computers..."), I searched for Access on my client computer. Ultimately, I don't have the Access file directly on my client machine. Instead I only have the "(2).lnk" shortcut in my user profile.
    - I don't know if the latter makes a difference. I'd try it at home (where I do have Access); however, AutoUpdater doesn't seem to work if NOT on a LAN (which is another issue).

    My question:
    1. Based on the information shown in the Immediate Window, do you know what might be causing the error? Is it the "Access shortcut" vs. "Access App"? Or could it be something different?
    2. Also, please keep in mind that the original version (from 2003) was posted in "MDB" format. I made some mods to change from "MDB" to "ACCDB" but I'm not entirely certain if there are additional steps (in the VBA) I need to make as part of the conversion process.

    Thanks,
    Tom

    P.S. Attached is the updated AutoUpdater db.
    Attached Thumbnails Attached Thumbnails Error_Debug.JPG  
    Attached Files Attached Files

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The file for the Access file doesn't look right. My variable resolves to

    "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE "

    You want the path to the actual Access program file, "MSACCESS.EXE". I use this so I don't have to know where it is:

    http://www.theaccessweb.com/api/api0023.htm

    Testing from the Immediate window:

    ?ffindexe("AutomatedEmailImport.mdb","C:\AccessAp" )
    C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul:

    Given that I'd need to run this on the LAN, I would have to first speak w/ a system admin to determine a work-around. That is, when I right-click on Access and then view the properties/location, the shortcut is the only one that comes up. I'm sure that's due to any client machines not having Access directly installed on their machine. Ours is NOT a thin client but I still don't believe that Access is installed on my work laptop. Again, I'll have to check w/ our SysAdmin.

    In the meanwhile, I'd like to determine if this truly the problem, so I need to test it from home. Once I configure the two folders (LAN-mimicking and client-mimicking) and then attempt to change the folder path in frmSetup, I then get an error message referencing 32-bit. My personal computer is 64-bit...

    Pls see attached the error message. After the 1st one, I then commented out those five lines. It resulted then in another error #2.

    My question: How do I modify the lines of code to reference to 64 bit?

    Thanks,
    Tom
    Attached Thumbnails Attached Thumbnails Error 1.JPG   Error 2.JPG  

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Add the bit in red:

    Declare PtrSafe Function
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul... perfect... I'm almost there (I think)!

    1. I added PtrSafe to the particular lines.
    2. AutoUpdater does now the following. It compares the two versions and if server FE is newer, it replaces the client FE.
    3. Then, AutoUpdater opens the client database. Excellent!!!

    And, adding the .EXE Access path is required for this to work. Again, I will have to talk to our SysAdmin but I feel at least more comfortable knowing it works on my home computer.

    Last thing for now... having added PtrSafe reference **may** have resulted in a negative impact on the 3 **Browse** buttons. Although not critical, I certainly would like the Browse window to pop up in frmSetup. It worked in previous version.

    Is there a quick fix for that too? If so, I'd welcome feedback on the mods. Attached is the current frmSetup (highlighted the 3 buttons in yellow that currently don't work). Also, attached is the latest version of AutoUpdater.

    Thanks in advance,
    Tom


    Attached Thumbnails Attached Thumbnails BrowseButtons.JPG  
    Attached Files Attached Files

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    My VM with 64bit isn't running right now so I can't test. You can get away from the API dependent method:

    https://docs.microsoft.com/en-us/off...ion.FileDialog

    Though I'd use late binding.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul -- I replaced the function but now receives an error on Me.FileList.RowSource = ""

    Not sure what "late binding" is. RGR on your 64-bit being down... any additional feedback how to resolve the browse button error will be appreciate. Try to keep the VBA as simple as possible.

    Thanks,
    Tom

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That was just an example, you just want to grab the name, not populate a listbox:

    Code:
      Dim fDialog As Object
      Dim varFile As Variant
      
      Set fDialog = Application.FileDialog(3)
        
      With fDialog
      
        .AllowMultiSelect = False
                  
        .Title = "Please select one file"
      
        .Filters.Clear
        .Filters.Add "Access Databases", "*.mdb, *.accdb"
        .Filters.Add "All Files", "*.*"
      
        If .Show = True Then
          For Each varFile In .SelectedItems
            MsgBox varFile
          Next
        Else
          MsgBox "You clicked Cancel in the file dialog box."
        End If
      End With
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Brilliant... absolutely brilliant, Paul. Thousands thanks for the continued assistance. It now works perfectly on my home computer.

    Hopefully I can figure out a way to obtain access to the Access.EXE file vs. the "shortcut" (.lnk) at work.

    Again, thank you for all of your help. I very much appreciate it!

    Cheers,
    Tom

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

Similar Threads

  1. Replies: 14
    Last Post: 06-24-2014, 09:16 AM
  2. Replies: 2
    Last Post: 10-26-2013, 11:31 AM
  3. Replies: 0
    Last Post: 02-27-2013, 01:06 PM
  4. Replies: 4
    Last Post: 11-29-2012, 12:45 AM
  5. Replies: 0
    Last Post: 09-27-2011, 04:27 AM

Posting Permissions

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