We help IT Professionals succeed at work.

Opening a SSH (Tunnel) Connection from Access - PUTTY.exe

Karen Schaefer
Medium Priority
Last Modified: 2008-02-01
I have a Access 2k3 database that uses an ODBC Connection to a MYSQL database, Thanks to some experts at experts-exchange that works great.  Unfortunately, in order to access the MySQL server I have to open a SSH connection via Putty.exe.  Due to timeout issues, just leaving the connection open is not good enough.  I am looking for a command line code or Shell command that I can use thru VBA  or bat file to open the connection, pass the user name and password.

I am trying to setup a scheduled task that will run in the middle of the night and this is my only obstacle.


Watch Question

IT Manager
I'm not sure how Putty.exe works but here's what I use to ftp webpages from within Access

I create a batch file to call the ftp program

ftp.exe -s:c:\FOLDER\spec_FOLDER.txt

I name the file ftp_FOLDER.bat

The ftp command is calling a specification file named spec_FOLDER.txt

open www.website.com
put c:\FOLDER\webpage_index.htm index.htm
put c:\FOLDER\991515.html
put c:\FOLDER\991515_hold.html



I have a scheduled task set to run how ever often the client wishes.  The task calls an Access application with it's Autoexce macro set to run a function that kicks everything off.

to call the batch file from the Access function

varRet = Shell(rsCom!FilePath & "\" & strBatFileName, 1)

OM Gang

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
omgangIT Manager

Here's a link to the Putty FAQ page

If it were me, I'd probably start by tying out the command line option
putty -ssh host.name


Secton 6.4 discusses calling a saved session
varRet = Shell(c:\path\to\putty.exe -load "mysession")

Try experimenting with a batch file that calls the exec (like above) and passing user and pass like in my sample ftp batch file.

Next, look at 4.3 re. embedding putty in another program.

OM Gang
Karen SchaeferBI ANALYST


Thanks to everyones input unfortunately due to security issues at my office I will be unable to use any of theses suggestions.

Security will not allow me to  pass the private key or public key to the server.  This is final.  So I was force to give my code to the IT department to be run thru the use of PHP.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.