I have this Access module that uses Putty to put a file to our corporate server if I can figure out where/how to put the "Put" command in the strcommand line. It connects, fine just need to know where to put the Put. Any help is greatly appreciated. Code is below...
Option Compare Database
'"C:\Program Files\PuTTY\pscp.exe" -sftp -l hans -pw changeme C:\Access\sample.txt 192.168.1.6:/home/hans/
'So this procedure will build and run that command string.
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 & " -sftp -l " & pUser & " -pw " & pPass & _
" " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 1 ' vbNormalFocus '
End Sub
Option Compare Database
'"C:\Program Files\PuTTY\pscp.exe" -sftp -l hans -pw changeme C:\Access\sample.txt 192.168.1.6:/home/hans/
'So this procedure will build and run that command string.
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 & " -sftp -l " & pUser & " -pw " & pPass & _
" " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 1 ' vbNormalFocus '
End Sub