Solved

Simple file transfer through vb

Posted on 2004-08-27
5
187 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
  • 3
5 Comments
 
LVL 10

Expert Comment

by:anv
Comment Utility
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_
Comment Utility
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
Comment Utility
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
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
Comment Utility
hello pcjunky!!!

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

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

743 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

18 Experts available now in Live!

Get 1:1 Help Now