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 FTP Commands in Access

Status
Not open for further replies.

BattleDroid42

Programmer
May 17, 2002
100
US
Has anyone out there programmed a way to FTP files from Microsoft Access? Here's the core of what I would like to be able to do:

For y = 1 To z
For x = a To b
strDay = Format(x, "00")
strDatabase = Forms![frmStatusByDatabase02]![Database]
strFrom = LCase(strSourcePath & strDatabase & "\LG" & strMonth & strDay & strYear & ".DAT")
strRecip01 = LCase(strDestinationPath & strDatabase & "\LG" & strMonth & strDay & strYear & ".TXT")
SysCmd acSysCmdSetStatus, "Processing " & strFrom & " to " & strRecip01
If FileExists(strFrom) = True Then
MkDir strDestinationPath & strDatabase
FileCopy strFrom, strRecip01
Else
End If
Next x
DoCmd.GoToRecord acDataForm, "frmStatusByDatabase02", acNext
Next y

Basically the user enters a date range in a dialog box setting all the date variables. The routine will pull all the files in a pre-specified list of directories for the date range entered.

The outer loop changes the "database" folder name and the inner loop pulls a variable number of date stamped files. I want to replace the FileCopy command with FTP commands and place the files from the UNIX box in local directories for later import into Access. All of the variables are stored in tables.
 
I've tried this article before and have never gotten it to work. It always returns an error:

Run-time Error '35754'

Method 'Execute' of object 'IInet' Failed

The code is simple enough just doesn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top