I need to send the results of a query to an ftp Site could anyone help in simple terms please I'm very new to this and trying to teach myself thanks a lot.
N
One approach is to create a DOS Batch Program that contains all the necessary FTP Commands. This assumes that the file being transported has a static file name and you do not need to perform any type of encryption, like pgp.
If the file being transported changes files names, you may need to create the DOS Batch Program on the fly through MS Access and change the file name as necessary.
Fininally, after you have a DOS Batch Program that works, you can use the Shell() to launch the DOS Batch Program.
Here is a code example of what I do to get a directory list.
.... Excerpt from code ....
Dim sCorrectedFilePath As String
Dim sFilePath As String
Dim sCommand As String
On Error GoTo Create_Dir_List_Error
'create a directory listing batch file.
sCommand = "dir " & lcBase_Path & "*.mdb /s /b /o-s >" & APP_PATH & "dir_list_mdb.lst"
Open APP_PATH & "dir.bat" For Output As #1
Print #1, sCommand
Close #1
wHandle = Shell(APP_PATH & "dir.bat")
'delay to wait for the directory list
'file to finish writing from the bat command. This is necessary becuase
'the Shell command is asyncronous
DelayTime 6
appLoop wHandle
Public Function DelayTime(PauseTime As Integer)
Dim start
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop
End Function
Sub appLoop(wHandle As Long)
On Error GoTo errorhandler
Do While 1
AppActivate wHandle, False
Loop
errorhandler:
Exit Sub
End Sub
Steve Medvid
"IT Consultant & Web Master"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.