FTP.exe fail in mde

Freshman

Registered User.
Local time
Today, 02:33
Joined
May 21, 2010
Messages
437
Hi all,
I have a weird one here:
I pass parameters in a txt file to the standard Windows FTP.exe program to upload certain files to my ftp server.
It works 100% when in mdb format but as soon as I convert to mde it either doesn't upload the file/s or upload with file size as zero.

Is there maybe a security block/unblock issue with ftp and mde?

Thanks
Pierre
 
i would put in the code a load of message boxes to trace what is going on, and have a temporary "debug" setting. to activate the message boxes. At least you may then get some insight into the problem.
 
Thanks - but there is not much happening between setting the parameters and passing the txt file to the ftp.exe program which makes it difficult.
So far the only "consistency" I'm getting is that the largest of the 3 files always upload succesfully but then the 2 smaller files fail.
I tried changing the sequence in which they upload but the result stays the same.
Not sure if I can put a "wait" command in the ftp.exe script to make sure the big file only uploads after the smaller ones have.

PS: All still uploads in MDB format however
 
What are the parameters you're passing to the function?
 
I tried the following as a seperate piece of code for each file upload.

FileNo = FreeFile
ChDir "C:\LabourSoft\Data\FTP"
Open "ftp-cmd.txt" For Output As #FileNo
Print #FileNo, "open ftp.laboursoft.co.za"
Print #FileNo, "laboursoft.co....."
Print #FileNo, "oteg....."
Print #FileNo, "binary"
Print #FileNo, "cd " & FTPServerDir
Print #FileNo, "send " & FTPFileName
Print #FileNo, "close"
Print #FileNo, "quit"
Close #FileNo
On Error Resume Next
Shell "ftp.exe -s:ftp-cmd.txt", vbHide

Then I also combined it for the 3 files like so:

FileNo = FreeFile
ChDir "C:\LabourSoft\Data\FTP"
Open "ftp-cmd.txt" For Output As #FileNo
Print #FileNo, "open ftp.laboursoft.co.za"
Print #FileNo, "laboursoft.co....."
Print #FileNo, "oteg....."
Print #FileNo, "binary"
Print #FileNo, "cd " & FTPServerDir1
Print #FileNo, "send " & FTPFileName1
Print #FileNo, "cd " & FTPServerDir2
Print #FileNo, "send " & FTPFileName2
Print #FileNo, "cd " & FTPServerDir3
Print #FileNo, "send " & FTPFileName3
Print #FileNo, "close"
Print #FileNo, "quit"
Close #FileNo
On Error Resume Next
Shell "ftp.exe -s:ftp-cmd.txt", vbHide

Both methods work in MDB but only the biggest of the 3 files upload in both methods when in MDE format.
I tried Send and Put as commands.

I will now call the upload code from 3 diffent command buttons and a 4th button to upload all 3 files and see it I can spot a problem.
 
  1. if you run the ftp bat outside Access does it do its thing with the same files that fail when run throoug Access shell call?
  2. in the shell you normaly need to provide the full path (with paths with spaces wrapped in Chr(34)) Update: just noted you have ChDir... so
 
I'm struggeling to get the syntax correct for the bat file. Thought I would be easier??
Still working on that as that might be the best way I agree = to do it outside of Access.

Thanks - there is no spaces in the file path
 
Perhaps your Antivirus or Firewall is disallowing the use of that windows file. ftp.exe has been known to be a trojan, i.e. some trojans have used that file name to cause havoc.
 
spikepl - you are the man!!
The answer was the space in the file name. But let me explain:

I have the following code at the start of the script:
If Right(CurrentProject.Name, 1) = "B" Then.....in which I change the file name (client's store name) to a dummy 6 character name - in this case "mytest".
So that I don't upload data into a real clients folder on my server.

However when I run the mde file, the Right(CurrentProject.Name, 1) "e" thus using my "demo store" also for testing purposes. But I forgot that it looks at the first 6 characters which then includes a space in the file name.

Wow - how silly!!! - I now simply use "demostore"

PS: Over the years I always made sure I run code to remove spaces from client's store names but I forgot about my own "test store"

Thanks again for all your input. I was going crazy :)
 
So true - especially when you add new functionallity to a 5 year old app and you can't remember everything you did then that will impact on the new changes now.
Anyway - just glad I got this sorted in time to make the update deadline.
Cheers all
 

Users who are viewing this thread

Back
Top Bottom