Solved

ftp Download via MAcro/Code???

Posted on 1997-10-08
8
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

624 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