Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send A file To a FTP site 1

Status
Not open for further replies.

TomTiddle

MIS
Jun 16, 2004
6
GB
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
&quot;IT Consultant & Web Master&quot;

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top