Transfer PDF file to ftp server in MS access 2007

时光怂恿深爱的人放手 提交于 2019-12-13 02:45:37

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/13829932/transfer-pdf-file-to-ftp-server-in-ms-access-2007

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!