INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Read top value of MS Access table and write to printer via TCPClient / NetworkStream - Help

Read top value of MS Access table and write to printer via TCPClient / NetworkStream - Help

Read top value of MS Access table and write to printer via TCPClient / NetworkStream - Help

(OP)
Good day/evening everyone... I'm pretty fluent with basic MS Access (using 2003 here, but have 2007 available if I need some advanced functionality) and I have been fine with doing imports, exports, macros, and have done some custom things underneath buttons and on form loads with some basic VB, etc.. but nothing too intense on the VB side) Today, I have been presented with a challenge of reading an ASCII value from a table and sending that value to a controller for a printer that will be listening on particular IP address and port. After doing some research it look like using TCPClient, NetworkStream commands, etc. Something similar to below (I know this is not complete code). Anyway.. I'm way to raw at this and need some direction. Even starting with how to setup the module or get the right class involved. TCPClient is not recoginized even when I begin to type the code... I was told I needed to istall VB6 or Visual Studio on the system to see this... but no help. So I guess I need 2 things... Some direction in setting up the environment and some direction on the specific code... If I'm way off on the best way to do this I open to any advice. Also saw some example of adding a activeX winsock control to a form that would do the trick. Any help is greatly appreciated. Thanks! TMEAGLE2

Dim PrinterIP As Net.IPAddress
PrinterIP = Net.IPAddress.Parse("192.168.168.7")
Dim MyPrinter As New TcpClient(PrinterIP.AddressFamily)
MyPrinter.Connect(PrinterIP, 1024)
Dim stream As NetworkStream = MyPrinter.GetStream()
Dim data As [Byte]()
data = System.Text.Encoding.ASCII.GetBytes(Me.lblPOSDesc.Text)
stream.Write(data, 0, data.Length)

RE: Read top value of MS Access table and write to printer via TCPClient / NetworkStream - Help

You don't VB6, you need VB.net and Visual Studio, thats a .net class

RE: Read top value of MS Access table and write to printer via TCPClient / NetworkStream - Help

You don't VB6, you need VB.net and Visual Studio, thats a .net class

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close