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)
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)