문제

I'm attempting to upload a pdf file to an ftp server. I've tried this by accessing the wininet dll but unsuccessfully.

What is the best way to do this in MS Access 2007 VB6? I can call a .net dll, but that is my last resort.

Thank you in advance.

도움이 되었습니까?

해결책

If you mean VB6 then there's a control you can use for FTP functions. Go to Project/Components and add the "Microsoft Internet Transfer Control" to your project. It's fairly easy to use, but something like...

    Inet.UserName = "Username"
    Inet.Password = "Password"
    Inet.Protocol = icFTP
    Inet.RemoteHost = "123.123.123.123"

    Inet.Execute , "put " & sFileToTransfer & " " & sFilenameOnRemoteHost

    While Inet.StillExecuting
        DoEvents
    Wend

Check Inet.ResponseCode when it finishes

If you mean VBA in Ms/Access then you could write out a small batch file and then shell out to execute it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top