Solved

Simple file transfer through vb

Posted on 2004-08-27
5
193 Views
Last Modified: 2013-11-13
Hello,
  I'm attempting to write a program to operate on a remote client machine that will populate a .mdb file and then when finished upload that file to a server.  Once it's uploaded I want the program to initialize a program on the server to run on the uploaded file.  I really have no idea how to go about this, even a starting point would be greatly appreciated.  I have a vb program that will populate the .mdb file; so I really just need the file transfer part and the activation of the program on the server side. If you need more information let me know.  Thanks.
~pcjunky
0
Comment
Question by:pcjunky
[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
  • 3
5 Comments
 
LVL 10

Expert Comment

by:anv
ID: 11919433
use winsock control and u'll have to use
FTP commands to connect to the server and upload the file..

check teh link below:

http://www.vbip.com/protocols/ftp/vb-ftp-client-library/tutorials/tutorial-06.asp
0
 
LVL 7

Expert Comment

by:_agj_
ID: 11919434
use winsock to create a simple server and client.

if u dont want to write much code, rather set up an ftp server.

and ftp it to the server.
0
 
LVL 10

Expert Comment

by:anv
ID: 11919457
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 11924174
Copying the file is trivial.  You can use FTP or if you don't have FTP capabilty, or don't want to use it, then you can copy the file the old fashioned way.  Something like:

    Dim objFSO As New FileSystemObject
    objFSO.CopyFile "Source", "Destination"
    Set objFSO = Nothing

Initializing the program on the server requires you to make a choice.  There are several possibilites for handling this.  One, as both anv and agj suggested, you could use the Winsock control.  This'll require that the program on the server be running all the time, listening for a message from the client program telling it to run.  To use this approach you'll need to add the Winsock control to both the client and sever programs.  The client will attempt a conenction to the server and, if successful, send it a message telling it to that there's a file to process.  Two, if you don't want to use Winsock to handle this, then you could accomplish the same thing by simply writing a text file to a certain folder.  The folder would act as a queue that the server would watch.  When it sees a file appear there it jumps into action.  The logic is essentially the same as the Winsock approach, but doesn't require using Winsock.  As with Winsock, this method will require that the server program be running all the time.  If you like this option, then here a program (http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=41816&lngWId=1) that demonstrates how to watch a folder.  Three, if you don't want to have a server-side program that's running all the time, then you could use PSExec (http://www.sysinternals.com/ntw2k/freeware/psexec.shtml) from SysInternals.  Using it you can launch the server-side process from the client machine.  The only requirement is that the client will need to have sufficient permissions to launch the server process.  Four, if the files don't need to be processed immediately, then you could use Windows Scheduler to schedule the server-side program to run once an hour, or every 30 minutes, or however often you feel is appropriate.  Each time it ran it'd look for databases that'd been uploaded since it's last run.  This makes for a very simple program.  Its only downside is that files won't be processed immediately.  Some of them will sit there for awhile.  Fundamentally it's a choice between how quickly files need to be processed and how complex a program you want to create.

Hope this helps.
0
 
LVL 10

Expert Comment

by:anv
ID: 12245903
hello pcjunky!!!

Did u check the posts or not...???

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

724 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