How to use sftp from within an MS Access database module

Posted by: 08-bases-mohair on 21 December 2022, 8:06 am EST

  • Posted 21 December 2022, 8:06 am EST

    I have a requirement to create a simple database in Access to collect some user data that will be loaded into another database for further reporting. There will be a module in the Access db that when invoked by the user (probably by clicking a button) will output a query to a delimited file. The user also needs a mechanism (for example a form with a button) to easily transfer the file to a remote server, using sftp. Does anyone have an idea of how to accomplish this?

  • Posted 11 April 2023, 5:43 am EST

    You can simply write a call to the sftp command line client via a batch file if you want to accomplish that.

    Check out the Shell() function in VBA.

    Under the click event of the button on your form add in the code:

    mySFTPCall = “sftp <insert your options here!>”

    Call Shell(mySFTPCall, 1)

    I’ve used this before to just copy files straight across network shares etc. to share data from an in-house Access DB. Of course you could get more fancy if necessary.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels