Solved

ftp Download via MAcro/Code???

Posted on 1997-10-08
8
212 Views
Last Modified: 2006-11-17
I have some data files on a UNIX system that I would like
to download as part opening the database, (ie. in the Autoexec macro).  I have some experience with coding VBA (this is for Access95/97), and was wondering if anyone knew how to automate the ftp download process of these data files.  Its through a network, so no modem stuff is required.  Any ideas or thoughts????
0
Comment
Question by:mfischer2
  • 4
  • 3
8 Comments
 
LVL 3

Accepted Solution

by:
chapie earned 130 total points
ID: 1956905
I have an application that launches the 'net' command to grab the system time of our server so they can all be synced, so you sould be able to use the same method to use the ftp command that comes with Win95, you just need to fill any paramaters that might be required...try something like the following:

Dim MyCmd
MyCmd = shell("ftp \\server_name\File")

and insert into the quotes the username and password if any are requried

I do have 1 warning that I have not been able to circumvent, which is there is a new app created in the task list called 'mycmd' whenever this app is launched, and if they launch the app several times without re-booting they all hang in  memory, even if I insert a MyCmd = nothing into the lines of code that I use, so if anyone else has a better way please post
0
 

Author Comment

by:mfischer2
ID: 1956906
2 Questions for you:

1.  Whats the syntax to login thru command line ftp?  I didnt follow where to put the username and password

2.  Does that return the actual text data into a variable called MyCmd or what?  (excuse by VBA, its a little rusty)

This is a good start for now!   I will also let you know what I discover about getting rid of the application icon.
0
 
LVL 3

Expert Comment

by:chapie
ID: 1956907
well, it's not actually an application icon, it's a task that shows up when you press ctrl-alt-del and you can kill it that way.

I'm not sure why VBA reuires you to use a variable when shelling out, but that's the way it works, you simply Dim a variable name and use it in the shell command, there's nothing anymore I can tell you except that it works nd that's as far as I've taken it

the syntax for ftp, good question I don't use the command line, I usually use a 3rd party utility (FTP client), but you can use the 1 that comes with Win95 (a path would probably be best since users could have a client installed)....I'll ask my co-worker tomorrow the proper syntax...he loves command lines as opposed to 3rd part software, so he'll know, he does it all the time at work, instead of loading an app, just typing it in at a dos prompt


0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:mfischer2
ID: 1956908
I follow.  Let me know about ftp.
0
 
LVL 3

Expert Comment

by:chapie
ID: 1956909
well, I asked my co-worker and he doesn't know how to launch an ftp session with 1 command, instead he'll enter the server, then the log-in requestino returns, etc.

Let me see if we can circumvent that problem with a different type of solution, 1 you might not like since it could require the user to click a url on a form that pops-up.

Create a simple form that starts when the DB is opened (using the AutoExec macro, not the startup option, if you already have one there, that's how I open multiple forms since the startup option only allows 1 to be auto opened), then add a url - all I did was put a label on a blank form, and fill in the URL property.

Now, all you have to find out is what the syntax is for logging someone into FTP through HTML, and since I don't have an FTP server that anyone could log into I don't know that syntax but it should be easy enough to find out
0
 

Author Comment

by:mfischer2
ID: 1956910
Thanks!  I have 2 solutions that might work now.

URL on a form.

FTP download via the Autoexec macro (I will probably get a new client that allows using a script file).  

This is a great start.


0
 
LVL 1

Expert Comment

by:arimsoft
ID: 1956911
In VB5.0 there is ActiveX "Transfer Protocol..."
Use it and read help (F1)
It's easy.

Welcome to MAUG!
http://www.arimsoft.ru/msaccess/
0
 
LVL 3

Expert Comment

by:chapie
ID: 1956912
that's right, I've forgotten about ActiveX and the "FTP"/"Transfer protocol" or whatever the control is named (depending on which manufactuer, since I'm sure there are several controls out there that would do the same)
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question