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

Posted on 2006-03-29
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.


Question by:Karen Schaefer
    LVL 28

    Accepted Solution

    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

    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
    LVL 28

    Expert Comment

    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


    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

    Author Comment

    by:Karen Schaefer
    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.


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now