Upload Validation with Access VBA

Advertisement

johnd2202
Joined:
Posts:
1
Location:
North Carolina

Upload Validation with Access VBA

Hi all,

So we have successfully uploading a file using MS Access VBA and WinSCP. The issue is that we want to be able to validate that the file processed correctly in the Unix server. There are two other folders on the server, one called errored and one called completed. When the file is processed, it will be moved to one of those folders depending on whether the server application successfully processed it or not. Is there a way through WinSCP scripting to be able to view the folder contents in Access using VBA? Or any other way of validation for that matter?

I'm a noob when it comes to this so any help is greatly appreciated.

Thanks,

John

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Upload Validation with Access VBA

You can use the ls command and XML logging and parse the XML log.
https://winscp.net/eng/docs/logging_xml

More hackish approach would be to just redirect winscp.com output (with the ls output) to a text file and parse that.

The most reliable approach is using the the WinSCP .NET assembly and its Session.ListDirectory method from VBA.
https://winscp.net/eng/docs/library_vb
On the other hand, this requires registration of the assembly, what complicates distribution of the code (if that's required).

Reply with quote

Advertisement

You can post new topics in this forum