Solved

transfer data between 2 computers Using direct cable

Posted on 2000-02-16
4
185 Views
Last Modified: 2010-05-02
Can I transfer the data between 2 computers use direct cable connect by VB and how ?

Can you give me a sample with it ?

Thank you very much.
0
Comment
Question by:qkhoi
  • 3
4 Comments
 
LVL 3

Expert Comment

by:3rsrichard
ID: 2529098
Sure you can.
Here's how you would send the string TXBUFF$

  Form1.MSComm1.CommPort = 1
  Form1.MSComm1.Settings = "1200,N,8,1"
  Form1.MSComm1.PortOpen = True
  Form1.MSComm1.InputLen = 0
  Form1.MSComm1.Output = TXBUFF$

Heres how you could receive
  RXBUFF$ = ""
  Form1.MSComm1.CommPort = 1
  Form1.MSComm1.Settings = "1200,N,8,1"
  Form1.MSComm1.PortOpen = True
  Form1.MSComm1.InputLen =

  ComDelay = 0
  Do
    DoEvents
    RXBUFF$ = RXBUFF$ & Form1.MSComm1.Input
  Loop Until (ComDelay > 2)

Where ComDelay is hooked to a timer so that the program wont get hung up.
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 2530049
Yes, MSCOMM control can be used if you have modem cabel connected to the serial port of the computers. This is exactly what 3rsrichard  is trying to explain. In the above example connect the cable between 2 com1 serial port.
>>>Can I transfer the data between 2 computers use direct cable connect by VB and how ?
0
 
LVL 3

Expert Comment

by:3rsrichard
ID: 2531216
If you use a cable only, then you have to have something to swap the wires on pins 2 and 3.  A "Null Modem" or other device you can get at a parts store.
0
 
LVL 3

Accepted Solution

by:
3rsrichard earned 100 total points
ID: 2532319
gkhoi
  You should provide some response.
Sure you can.
Here's how you would send the string TXBUFF$

  Form1.MSComm1.CommPort = 1
  Form1.MSComm1.Settings = "1200,N,8,1"
  Form1.MSComm1.PortOpen = True
  Form1.MSComm1.InputLen = 0
  Form1.MSComm1.Output = TXBUFF$

Heres how you could receive
  RXBUFF$ = "" 
  Form1.MSComm1.CommPort = 1
  Form1.MSComm1.Settings = "1200,N,8,1"
  Form1.MSComm1.PortOpen = True
  Form1.MSComm1.InputLen =

  ComDelay = 0
  Do
    DoEvents
    RXBUFF$ = RXBUFF$ & Form1.MSComm1.Input
  Loop Until (ComDelay > 2)

Where ComDelay is hooked to a timer so that the program wont get hung up.
If you use a cable only, then you have to have something to swap the wires on pins 2 and 3.  A "Null Modem" or other device you can get at a parts store.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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