Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The enviroment is simple, natural and efficient. The members are competent, educated and professionals..."

Geography

Where in the world do Tek-Tips members come from?

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

TMEAGLE2 (MIS)
13 May 12 20:47
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)
vbajock (Programmer)
12 Jul 12 10:39
You don't VB6, you need VB.net and Visual Studio, thats a .net class
vbajock (Programmer)
12 Jul 12 10:39
You don't VB6, you need VB.net and Visual Studio, thats a .net class

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!

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