INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

New Coder Trying to upload a file from MS Access to sFTP server using Putty(unix commands)

New Coder Trying to upload a file from MS Access to sFTP server using Putty(unix commands)

New Coder Trying to upload a file from MS Access to sFTP server using Putty(unix commands)

(OP)
Still no luck putting a file to the server :(...I have verified that I am connecting and disconnecting, but I need to know where and how to include the PUT command in the strCommand of my code as every way I have tried it is either incorrect syntax or in the method below it accepts the code format but isn't putting a file to the server. Any help would be greatly appreciated.

Public Sub SftpPut()
Const cstrSftp As String = """C:\Users\eay41o7\Downloads\putty\pscp.exe"""
Dim strCommand As String
Dim pUser As String
Dim pPass As String
Dim pHost As String
Dim pFile As String
Dim pRemotePath As String


pUser = "CareAdvantage"
pPass = "CareAdvantage01"
pHost = "mshrasftp.mckesson.com"
pFile = "O:\Corporate\FortWorth\SpecPharmacy\Report Repository CADV\Reports\Takeda_Shipping_Conf_Daily\Takeda_Data.txt"
pRemotePath = "/home/tomck/"

strCommand = cstrSftp & " -scp -l " & pUser & " -pw " & pPass & _
" put " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 1 ' vbNormalFocus '

End Sub

RE: New Coder Trying to upload a file from MS Access to sFTP server using Putty(unix commands)

Comparing your code to the example shown in the link below, I see a couple of differences:
1. pHost = "xxxxx" looks wrong.
2. strCommand = ... " -scp.. vs: " -sftp...

http://stackoverflow.com/questions/3754928/sftp-up...

When all else fails, manipulate the data.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close