Office中國(guó)論壇/Access中國(guó)論壇

 找回密碼
 注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

12
返回列表 發(fā)新帖
樓主: jzwwpp
打印 上一主題 下一主題

[新4]用ACCESS向ftp服務(wù)器上傳文件

[復(fù)制鏈接]
11#
發(fā)表于 2005-5-12 18:09:00 | 只看該作者
有沒(méi)有更好的方法!!!
12#
發(fā)表于 2006-3-9 17:50:00 | 只看該作者
高手啊。。。。。。。
13#
發(fā)表于 2006-4-17 02:20:00 | 只看該作者
可以使用Catalyst File Transfer Control 4.0 (SP3)控件

Private Sub Command6_Click() '上傳
Dim strLocalFullName As String
Dim strRemoteFullName As String
Dim lResult As Long

strLocalFullName = Me.TxtLocalName
strRemoteFullName = FullName(TxtRemoteFolder, TxtRemoteFileName)

    FileTransfer2.ServerType = GetServerType
    FileTransfer2.ServerName = Me.TxtSeverName
    FileTransfer2.ServerPort = 21
    '以下根據(jù)需要決定
    'FileTransfer2.Timeout = CLng(Val(editTimeout.Text))
    'FileTransfer2.UserName = Trim(editUserName.Text)
    'FileTransfer2.Password = Trim(editPassword.Text)
    lResult = FileTransfer2.Connect
    If lResult <> 0 Then
            MsgBox "Connection failed" & vbCrLf & FileTransfer21.LastErrorString
    End If
   
lResult = FileTransfer2.PutFile(strLocalFullName, strRemoteFullName)

If lResult <> 0 Then
            MsgBox "Transfer failed" & vbCrLf & FileTransfer2.LastErrorString
End If

lResult = FileTransfer2.Disconnect
End Sub


Private Function FullName(strDir As String, strFile As String) As String
Dim strDelim As String
Dim strLastChar As String

    strDelim = "\"
    If InStr(strDir, "/") > 0 Then strDelim = "/"
    strLastChar = Right(strDir, 1)
    If strLastChar = strDelim Then
        FullName = strDir & strFile
    Else
        FullName = strDir & strDelim & strFile
    End If
End Function
14#
發(fā)表于 2009-7-14 11:35:51 | 只看該作者
EZFTP控件?
15#
發(fā)表于 2009-7-14 22:12:23 | 只看該作者
學(xué)習(xí)一下
16#
發(fā)表于 2014-4-17 21:46:40 | 只看該作者
學(xué)習(xí)
回復(fù)

使用道具 舉報(bào)

17#
發(fā)表于 2015-1-9 20:29:16 | 只看該作者
不錯(cuò)
回復(fù)

使用道具 舉報(bào)

12
返回列表 發(fā)新帖
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則

QQ|站長(zhǎng)郵箱|小黑屋|手機(jī)版|Office中國(guó)/Access中國(guó) ( 粵ICP備10043721號(hào)-1 )  

GMT+8, 2024-10-23 06:25 , Processed in 0.092682 second(s), 28 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復(fù) 返回頂部 返回列表