Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

ftp Download via MAcro/Code???

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
mfischer2
Asked:
mfischer2
  • 4
  • 3
1 Solution
 
chapieCommented:
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
 
mfischer2Author Commented:
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
 
chapieCommented:
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
mfischer2Author Commented:
I follow.  Let me know about ftp.
0
 
chapieCommented:
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
 
mfischer2Author Commented:
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
 
arimsoftCommented:
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
 
chapieCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now