Use vbScript to Deploy your Access Front End, Create Shortcuts, and Check for Updates on User Login

Поделиться
HTML-код
  • Опубликовано: 24 янв 2022
  • In this episode, we're going to deploy our Access database app using a script that can be used in a user's startup folder. This will be a script that will check if the app has been deployed, create the deployment folder and retrieve the front-end file from the server, put a shortcut on the user's desktop if needed, and then check if the front-end is the current version each time the user logs into their computer. This kind of script can save developers a lot of time on administration tasks and user management. Let's go and deploy our Access front-end using vbScript!
    Related Videos:
    How to disable and enable the Bypass Key on your MS Access app so users cannot bypass Autoexec/Forms
    • How to disable and ena...
    Link and Relink Your Access Front-End App Using vbScript and a Table-Based Approach
    • Link and Relink Your A...
    How to Use vbScript to Relink Your User's MS Access Application Front-End Automatically
    • How to Use vbScript to...
    Use vbScript to Deploy your Access Front End, Create Shortcuts, and Check for Updates on User Login
    You are watching this video now!
    How to Encrypt and Hash Passwords in MS Access
    • How to Encrypt and Has...
    How to Encrypt Sensitive Data in Microsoft Access
    • How to Encrypt Sensiti...
    How to Kick Users out of Your MS Access Database
    • How to Kick Users out ...
    How to Get the IP Address in Microsoft Access
    • How to Get the IP Addr...
    How to Get the Windows Username in MS Access
    • How to Get the Windows...
    How to Set Basic Startup Options on Your Microsoft Access Database
    • How to Set Basic Start...
    For developers looking for a new role, check out and sign up:
    www.toptal.com/qKaO2b/worlds-...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com/qKaO2b/worlds-...
    Want to get access to premium content made just for you and have a chat with me? Find me on Patreon :
    / mackenziedataengineering
    Demo of my BZ RDP Cloaker:
    www.patreon.com/posts/how-to-...
    Want to work with me 1:1? Contact me today and book your free 20 min consultation!
    Contact form you can find at www.mackenziemackenzie.com/
    Follow me on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksynergy.com/fs-bin/...
    Got a RUclips Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy.com/seanmackenz...
    #vbscript #msaccess #vba
    • Use vbScript to Deploy...
  • НаукаНаука

Комментарии • 25

  • @miles6875
    @miles6875 Год назад +1

    Excellent video - thanks Sean!

  • @bumpersmith
    @bumpersmith 2 года назад +1

    Definitely interested in a linking video. These are very helpful.
    Also a compact and repair script for the backend and the front end would be very helpful.
    Thank you

  • @billdowler
    @billdowler 2 года назад +1

    Great video Sean. Is there somewhere where we can download the script file?

  • @simonmaersk
    @simonmaersk Год назад +1

    This is great! Is there anywhere I can download your script? Thanks!

  • @RockasKane
    @RockasKane Год назад +1

    And yet, another question.
    I managed to set a custom Icon to the desktop shortcut through the vbs inserting the code to copy the ico file to the deploy folder as the db file and then I added objShortCut.IconLocation = strDeployFolder & "\MyApp.ico" ... so far so good.
    But now I want to add /runtime in the end of the shortcut target but even if i type "/" my shortcut always gets a "\" so I have a resilt with
    untime and ofc this won't run.
    Any clues on how can I add the "/runtime"?
    Thank you so much for your time.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад +1

      I don't think I've run into that one before! Are you able to set the target of the shortcut programmatically as well? ie. objShortCut.Target = ..
      To do it with double quotes, you may have to do something like:
      strTarget = Chr(34) & "C:\whatever\my file.accdb" & Chr(34) & " /runtime"
      objShortCut.Target = strTarget
      No idea if .Target is available, it could have another name / you may have to research it.

    • @RockasKane
      @RockasKane Год назад

      @@seanmackenziedataengineering No luck.... I get an error "error: Invalid procedure call or argument" "code: 800A0005" "Source: Microsoft VBScript runtime error
      Anyway... I managed to get what i want just pointing the shortcut to my vbs file and launch the db from it.
      I also changed the version check routine to get the date from a txt file... in my case it is alot faster.
      That txt file is created with the database everytime I change the Application Title.
      If you, for some reason, you want to check my changes, I can send you the code, no problem.
      I know I am repeating myself alot, but you can't imagine how much I am learning from you. THANKS!!!

  • @anhtung1364
    @anhtung1364 Год назад +1

    Can i dowload a .accde file from ggdrive or one drive…. By use vbs file?
    Thanks you so much!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      I'm pretty sure you can! I have not done it - perhaps a future episode. These guys tried with VBA: stackoverflow.com/questions/66147047/download-google-drive-file-from-excel-sheet-using-vba

    • @anhtung1364
      @anhtung1364 Год назад

      @@seanmackenziedataengineering Thanks you

  • @ODOLTechAdvisor
    @ODOLTechAdvisor Год назад +1

    I don't know if you check these comments still but I appear to be having an issue getting this work when the folder doesn't already exist. I will always get a "Path not found" error on the line that is trying to create the folder in the first place. In the DoFullDeploy Sub, on the line of If blnFolderExists = False Then objFso.CreateFolder strDeployFolder.
    Did something get left out of the code? I've looked up other "Create Folder" code snippits and tried to use those in place of this, but they all come back with the same error of "Path not found". I know it's not found, it hasn't been created yet, that's what we are trying to do on this very line.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      Interesting - it is possible that blnFolderExists is false because it could not find the folder. But it is ALSO possible that the rest of your folder path is not valid (maybe a typo). Also, are there any spaces in your path? In that case you'll need to put some quotes around the path. ie.
      strDeployFolder = Chr(34) & "C:\dev\my folder with some spaces" & Chr(34)

    • @vastoholic2
      @vastoholic2 Год назад +1

      @@seanmackenziedataengineering It believe the answer is none of the above. My agency is controlled by another IT department and I don't believe we have the proper permissions to execute this directly into main C: drive folder. My permissions under C: show only Read & Execute, List folder contents, and Read. I think this is what is stopping the script from creating the folder. If I manually create the folder Dev under C: it will execute properly and create other subfolders under that. This throws a kink in my plans, lol. I was hoping to pass out this script alone to all my users. I may try to incorporate a way for the script to get the usernames so it will automatically create folders under their C:\Users\"USERNAME" folder. They should all have read/write permissions in there at least.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      @@vastoholic2 I see! That makes sense. If you need it, you can use the first method from this video to get the username in vbScript: ruclips.net/video/u9TRuwdT46U/видео.html
      Just remove "As String" from variable declarations since vbScript uses only Variant declarations (no types). Good luck!

    • @vastoholic2
      @vastoholic2 Год назад

      @@seanmackenziedataengineering Thanks. I realized it probably looks weird, but I made the original comment on my work account.

  • @lorenzogaruglieri7046
    @lorenzogaruglieri7046 Год назад +1

    hi Sean. Question: is it possible, via vbscript, to open a database with a password (obviously I know it) then remove the password, make a backup of the file with compaction (I have the code ready and I know that it is not possible to compact a file with a password with VBS ) and then reset the password?
    Then I would perform the following steps:
    1- open the db and remove the password
    2.backup with compaction
    3- reset the password
    What do you think?
    I need to know point 1 and 3
    Thank you
    Lorenzo

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад +1

      Hey Lorenzo, I think that is possible. In step 1 you can create an Access reference, ie something like:
      Set acc = WScript.CreateObject("Access.Application")
      acc.OpenCurrentDatabase(myDBName, False, "myPassword")
      Set db = acc.CurrentDB()
      'Do some stuff to backup
      acc.Quit
      I'm not sure about resetting the password. Great topic for a video! Needs a little research.

  • @RockasKane
    @RockasKane Год назад +1

    Hi again Sean.
    It's me buggin' again 🙂
    One question... wouldn't it be easier to write this code in am Access Module so it gets easier to detect errors and then copy paste it to a text file?
    I think it's possible but is it advisable?
    Thanks again for your great work 👍

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад +1

      Actually, that's a great idea! I have done this a few times myself over the years. You just have to resist the temptation to give variables their types before copying over to .vbs 😁

    • @RockasKane
      @RockasKane Год назад

      @@seanmackenziedataengineering Thank you 🙂