Topic "Using MS Access VBA to upload a folder to FTP Server"

Author Message
itcan
[View user's profile]

Joined: 2016-01-24
Posts: 3
I have an MS Access Application that makes a daily backup of the data files. During the process a folder is created on the LAN Server and the required data is copied to that folder. After the data is copied to the applicable folder we want the new folder to be uploaded to an FTP Server automatically.
I have the following code that I am battling with:

Code:
Private Sub btnDailyExport_Click()
   
Const ftpApp As String = """C:\Itcan\XXXX\bin\ftp\pscp.exe"""
   
    Dim strCmd As String
    Dim gUser As String
    Dim gPass As String
    Dim gHost As String
    Dim gFile As String
    Dim ftpSource As String

    ftpSource = "V:\Itcan\Backup\Daily Export\"

    gUser = "abcdefg"
    gPass = "123456789"
    gHost = "123.123.0.0:\root\foldername"
    gFile = ftpSource       'the folder name where the backup was made on the LAN Server
   
    strCmd = ftpApp & " -sftp -p -r " & gUser & " -pw " & gPass & " " & gFile & " " & gHost
   
    Shell strCmd, 1 ' vbNormalFocus '

    msgbox("FTP Done")

End Sub


I am running the latest software in all respects and I have tried just about every suggested solution I was able to find through Google. I have also added the applicable exceptions to the Firewall settings. All I get is a DOS Window that pops up and hangs around for 30 seconds and then closes.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
This is support forum for WinSCP, not pscp.

Consider asking on http://superuser.com/
itcan
[View user's profile]

Joined: 2016-01-24
Posts: 3
prikryl wrote:
This is support forum for WinSCP, not pscp.

Consider asking on http://superuser.com/


Well it doesn't not work with WinSCP either. I tried and there is just no way I could Register the dll. I then ended up with PUTTY and..
If you have a solution with WinSCP I will gladly try it. Its not which app I use to achieve the goal that is important here.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
itcan wrote:
and there is just no way I could Register the dll.

Means what? What did you try? What errors did you get?
itcan
[View user's profile]

Joined: 2016-01-24
Posts: 3
prikryl wrote:
itcan wrote:
and there is just no way I could Register the dll.

Means what? What did you try? What errors did you get?


Got it sorted the hard way - about 10 hours of trying things but i got it done.
It might be useful to other users to know that to register the dll in Windows 10, even though your .net version is 4.0xxxx use v3.5 in the command line.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License