Link to home
Start Free TrialLog in
Avatar of qkhoi
qkhoi

asked on

transfer data between 2 computers Using direct cable

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.
Avatar of 3rsrichard
3rsrichard

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.
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 ?
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.
ASKER CERTIFIED SOLUTION
Avatar of 3rsrichard
3rsrichard

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial