Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

CodeChica

IS-IT--Management
Dec 2, 2014
6
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top