Solved

transfer data between 2 computers Using direct cable

Posted on 2000-02-16
4
165 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

763 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

6 Experts available now in Live!

Get 1:1 Help Now