By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,945 Members | 1,650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,945 IT Pros & Developers. It's quick & easy.

Script for Access FTP

P: n/a
Does anyone have an example of an FTP script or module for use with Access
2003. I need to send a file from by computer to my web host from within
Access.

The from folder may or may not be the folder where I Shell to FTP
The to folder on the host is not the default folder

I am using:

Shell(ftp.exe -s: & script variable)

Script variable has

open 123 vbcrlf
username vbcrlf
password vbcrlf

That is all that in the script for now

When this is run all I get is a quick screen blink.

Nov 12 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When I did this I created a batch file that ran the ftp.exe program &
used the ShellWait program available here:

http://www.mvps.org/access/api/api0004.htm

I had to wait for the shelled batch file to finish so I could check if
the downloaded file had any data. Even if there isn't a file to
download the ftp program created the destination file on my system
anyway, but without data.

Using a batch file simplified running the ftp.exe program, 'cuz I
could change that file to point to the ftp.exe file & log files I used
to keep track of downloads. The batch file was kept in the same
folder as the application's front-end.

Here's the outline of my ftp script file:

open <ftp url>
user <user name> <password>
ascii
get <source> <destination>
bye

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDF8uYechKqOuFEgEQI3dACguTV33GLskR5mtfSgyXnwee pfg3IAoIZb
44IyzVLWyn7R3NV+fF/fMtfe
=S4P5
-----END PGP SIGNATURE-----
Karl Irvin wrote:
Does anyone have an example of an FTP script or module for use with Access
2003. I need to send a file from by computer to my web host from within
Access.

The from folder may or may not be the folder where I Shell to FTP
The to folder on the host is not the default folder

I am using:

Shell(ftp.exe -s: & script variable)

Script variable has

open 123 vbcrlf
username vbcrlf
password vbcrlf

That is all that in the script for now

When this is run all I get is a quick screen blink.


Nov 12 '05 #2

P: n/a
Pat
Karl,
I'm not sure if you can pass all the ftp commands as a string variable
(which, to me, is what it looks like you are doing).

Instead, consider using a txt file to store your FTP commands. If you are
doing the same steps (i.e. getting the same file) each time you plan to
connect (and you are not concerned w/ security), you can store a permanent
txt file that will hold your ftp commands. Your file would look something
like this:
If not, you can create a text file with your commands on the fly, then use
this file to FTP (e.g. ftp.exe -s: myftpfile.txt). Once you're done, you
can delete the txt file.

HTH,
Pat

"Karl Irvin" <88********@comcast.net> wrote in message
news:M49Yb.45442$uV3.90261@attbi_s51...
Does anyone have an example of an FTP script or module for use with Access
2003. I need to send a file from by computer to my web host from within
Access.

The from folder may or may not be the folder where I Shell to FTP
The to folder on the host is not the default folder

I am using:

Shell(ftp.exe -s: & script variable)

Script variable has

open 123 vbcrlf
username vbcrlf
password vbcrlf

That is all that in the script for now

When this is run all I get is a quick screen blink.

Nov 12 '05 #3

P: n/a
Pat
er, it would look something like this:

open ftp.website.com
{username}
{password}
binary
lcd C:\download
get {filename}
bye

PS - OE likes to interpret ctrl-V to mean send now!
Instead, consider using a txt file to store your FTP commands. If you are
doing the same steps (i.e. getting the same file) each time you plan to
connect (and you are not concerned w/ security), you can store a permanent
txt file that will hold your ftp commands. Your file would look something
like this:

Nov 12 '05 #4

P: n/a

"MGFoster" <me@privacy.com> wrote in message
news:M0*****************@newsread1.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When I did this I created a batch file that ran the ftp.exe program &
used the ShellWait program available here:

http://www.mvps.org/access/api/api0004.htm

I had to wait for the shelled batch file to finish so I could check if
the downloaded file had any data. Even if there isn't a file to
download the ftp program created the destination file on my system
anyway, but without data.

Using a batch file simplified running the ftp.exe program, 'cuz I
could change that file to point to the ftp.exe file & log files I used
to keep track of downloads. The batch file was kept in the same
folder as the application's front-end.

Here's the outline of my ftp script file:

open <ftp url>
user <user name> <password>
ascii
get <source> <destination>
bye

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDF8uYechKqOuFEgEQI3dACguTV33GLskR5mtfSgyXnwee pfg3IAoIZb
44IyzVLWyn7R3NV+fF/fMtfe
=S4P5
-----END PGP SIGNATURE-----
Karl Irvin wrote:
Does anyone have an example of an FTP script or module for use with Access
2003. I need to send a file from by computer to my web host from within
Access.

The from folder may or may not be the folder where I Shell to FTP
The to folder on the host is not the default folder

I am using:

Shell(ftp.exe -s: & script variable)

Script variable has

open 123 vbcrlf
username vbcrlf
password vbcrlf

That is all that in the script for now

When this is run all I get is a quick screen blink.

Nov 12 '05 #5

P: n/a
I created an application that is an interface between a webstore and a desktop
database. The webstore is essentially an order taker and the database manages
the store. Orders are manually ftped from the webstore and processed. Changes to
the webstore (new items, prices, inventory,etc) are all created in the database,
converted to a text file and ftped to the webstore manually. What you describe
here seems to be something I could use to automate the ftp process on both ends.
I have sone questions and requests:
1. What is the ftp.exe file?

2. Would you share your batch file and explain how to run it.

3. What is the ftp script file and how does it fit into the picture?

4. Would you share your actual script file.

Thank you very much for any help you can give me.

Steve
PC Datasheet
"MGFoster" <me@privacy.com> wrote in message
news:M0*****************@newsread1.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When I did this I created a batch file that ran the ftp.exe program &
used the ShellWait program available here:

http://www.mvps.org/access/api/api0004.htm

I had to wait for the shelled batch file to finish so I could check if
the downloaded file had any data. Even if there isn't a file to
download the ftp program created the destination file on my system
anyway, but without data.

Using a batch file simplified running the ftp.exe program, 'cuz I
could change that file to point to the ftp.exe file & log files I used
to keep track of downloads. The batch file was kept in the same
folder as the application's front-end.

Here's the outline of my ftp script file:

open <ftp url>
user <user name> <password>
ascii
get <source> <destination>
bye

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDF8uYechKqOuFEgEQI3dACguTV33GLskR5mtfSgyXnwee pfg3IAoIZb
44IyzVLWyn7R3NV+fF/fMtfe
=S4P5
-----END PGP SIGNATURE-----
Karl Irvin wrote:
Does anyone have an example of an FTP script or module for use with Access
2003. I need to send a file from by computer to my web host from within
Access.

The from folder may or may not be the folder where I Shell to FTP
The to folder on the host is not the default folder

I am using:

Shell(ftp.exe -s: & script variable)

Script variable has

open 123 vbcrlf
username vbcrlf
password vbcrlf

That is all that in the script for now

When this is run all I get is a quick screen blink.

Nov 12 '05 #6

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

1. The ftp.exe file is the ftp client application that comes w/ all
Windows systems. It is located in the Windows (WinNT) \system32
folder. Open a command window and type ftp at the prompt. It should
return with ftp> as the next prompt. Type bye to exit the ftp program
and exit to close the command window. There are also FREE ftp client
programs available on the web. Search thru Google for free software
or "ftp".

2. My batch file <modified to protect the innocent>:

=========== begin batch file =============

rem Used to run the ftp download from <source>.
rem Session responses are logged in FTP_.log
rem Save our system date & time 'cuz the <source> clock is different.

echo off

set DownloadRoot=\\<server name>\company\database\membership\import

rem All the following lines are ONE line >> appending info
rem into the FTP_.log file

echo BEGIN %date% %time% ================================ >>
%DownloadRoot%\FTP_.log

%SystemRoot%\System32\ftp.exe -s:%DownloadRoot%\FTP_.txt -n >>
%DownloadRoot%\FTP_.log

echo END %date% %time% ================================== >>
%DownloadRoot%\FTP_.log

set DownloadRoot=

=========== end batch file =============

3. The ftp script file is the file that holds the list of commands
that will be fed to the ftp.exe client application telling what URL to
attach to, what data transfer method to use to transfer files, what
remote file to get and where to put that file on the local system.

4. Here's the outline of my ftp script file (FTP_.txt):

open <ftp url>
user <user name> <password>
ascii
get <source> <destination>
bye

For a list of ftp commands (like those in the ftp script file) use the
System help (Start > Help) and search for ftp.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDKiDYechKqOuFEgEQJvFwCg+ackqJJ+iKdGbpdVE/dRgVhhPnoAoMig
aMV5b/gwo9rbdyiL6TulfgA9
=VQnH
-----END PGP SIGNATURE-----
PC Datasheet wrote:
I created an application that is an interface between a webstore and a desktop
database. The webstore is essentially an order taker and the database manages
the store. Orders are manually ftped from the webstore and processed. Changes to
the webstore (new items, prices, inventory,etc) are all created in the database,
converted to a text file and ftped to the webstore manually. What you describe
here seems to be something I could use to automate the ftp process on both ends.
I have sone questions and requests:

1. What is the ftp.exe file?

2. Would you share your batch file and explain how to run it.

3. What is the ftp script file and how does it fit into the picture?

4. Would you share your actual script file.

Thank you very much for any help you can give me.


Nov 12 '05 #7

P: n/a
Thank you very much!!

I learned a lot here.

Where do you enter the batch file? Is it saved as a file? Where can one learn
the language of a batch file? How is the batch file executed?

Steve
"MGFoster" <me@privacy.com> wrote in message
news:1m*****************@newsread1.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

1. The ftp.exe file is the ftp client application that comes w/ all
Windows systems. It is located in the Windows (WinNT) \system32
folder. Open a command window and type ftp at the prompt. It should
return with ftp> as the next prompt. Type bye to exit the ftp program
and exit to close the command window. There are also FREE ftp client
programs available on the web. Search thru Google for free software
or "ftp".

2. My batch file <modified to protect the innocent>:

=========== begin batch file =============

rem Used to run the ftp download from <source>.
rem Session responses are logged in FTP_.log
rem Save our system date & time 'cuz the <source> clock is different.

echo off

set DownloadRoot=\\<server name>\company\database\membership\import

rem All the following lines are ONE line >> appending info
rem into the FTP_.log file

echo BEGIN %date% %time% ================================ >>
%DownloadRoot%\FTP_.log

%SystemRoot%\System32\ftp.exe -s:%DownloadRoot%\FTP_.txt -n >>
%DownloadRoot%\FTP_.log

echo END %date% %time% ================================== >>
%DownloadRoot%\FTP_.log

set DownloadRoot=

=========== end batch file =============

3. The ftp script file is the file that holds the list of commands
that will be fed to the ftp.exe client application telling what URL to
attach to, what data transfer method to use to transfer files, what
remote file to get and where to put that file on the local system.

4. Here's the outline of my ftp script file (FTP_.txt):

open <ftp url>
user <user name> <password>
ascii
get <source> <destination>
bye

For a list of ftp commands (like those in the ftp script file) use the
System help (Start > Help) and search for ftp.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQDKiDYechKqOuFEgEQJvFwCg+ackqJJ+iKdGbpdVE/dRgVhhPnoAoMig
aMV5b/gwo9rbdyiL6TulfgA9
=VQnH
-----END PGP SIGNATURE-----
PC Datasheet wrote:
I created an application that is an interface between a webstore and a desktop database. The webstore is essentially an order taker and the database manages the store. Orders are manually ftped from the webstore and processed. Changes to the webstore (new items, prices, inventory,etc) are all created in the database, converted to a text file and ftped to the webstore manually. What you describe here seems to be something I could use to automate the ftp process on both ends. I have sone questions and requests:
>
1. What is the ftp.exe file?

2. Would you share your batch file and explain how to run it.

3. What is the ftp script file and how does it fit into the picture?

4. Would you share your actual script file.

Thank you very much for any help you can give me.

Nov 12 '05 #8

P: n/a
PC Datasheet,
Batch files are holdovers from days of DOS. It's a scripting language with
rather limited capabilities but useful still. Any text file ending with a
..bat extension will be interpreted by Windows as a batch file. As long as
the commands in the text file are valid commands that can be run from the
command prompt they will be run in sequence by Windows. What commands?
Anything Windows will do from a command prompt can be included.

"PC Datasheet" <sp**@nospam.spam> wrote in message
news:0z*****************@newsread1.news.atl.earthl ink.net...
Thank you very much!!

I learned a lot here.

Where do you enter the batch file? Is it saved as a file? Where can one learn the language of a batch file? How is the batch file executed?

Steve

Nov 12 '05 #9

P: n/a
Thanks, Alan!

Say I have a batch file named MyBatchFile.bat, how do I execute the file when
Access opens? In the middle of the application?

Steve
"Alan Webb" <kn*****@hotmail.com> wrote in message
news:q8*****************@news.uswest.net...
PC Datasheet,
Batch files are holdovers from days of DOS. It's a scripting language with
rather limited capabilities but useful still. Any text file ending with a
.bat extension will be interpreted by Windows as a batch file. As long as
the commands in the text file are valid commands that can be run from the
command prompt they will be run in sequence by Windows. What commands?
Anything Windows will do from a command prompt can be included.

"PC Datasheet" <sp**@nospam.spam> wrote in message
news:0z*****************@newsread1.news.atl.earthl ink.net...
Thank you very much!!

I learned a lot here.

Where do you enter the batch file? Is it saved as a file? Where can one

learn
the language of a batch file? How is the batch file executed?

Steve


Nov 12 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.