Solved

transfer data between 2 computers Using direct cable

Posted on 2000-02-16
4
173 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 71
VBA open file from excel cell 4 36
Macro: print each sheet to pdf using ExportAsFixedFormat 11 41
clicking a shape in a frame array vb6 3 40
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

867 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

12 Experts available now in Live!

Get 1:1 Help Now