Solved

ftp Download via MAcro/Code???

Posted on 1997-10-08
8
211 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
 

Author Comment

by:mfischer2
ID: 1956908
I follow.  Let me know about ftp.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now