473,811 Members | 3,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Winsocket control DataArrival data shows all garbled up

I tried using the windows winsocket control on my Access form and place
the recieved data in a text box. I got it to work but the data is
coming accross like ˙ţ%˙ý and I cant use that information. Is
there a way to descramble this. I'm thinking it might have to do with
using some sort of emulation that can read the info. We have software
right now that connects to our server with VT101 emulation. If this is
what is making it readable how can I convert the data or use a
emulation in my form?

Aug 4 '06 #1
2 3431
Actually I haven't even got that far as to send text out, this is just
scrambled data that i'm recieving when I connect. Normally in our
telnet software that came with our host system, when I connect it asked

me for my user name and password, I'm guessing this is what is coming
back accross to me but is unreadable, let me show you my code that i'm
using straight from Microsofts website. Let me know if you can see
where somehting might be incorrect.

Option Explicit
Const EchoPort = 23
Private Sub cmdConnect_Clic k()
Dim temp As String
temp = InputBox$("Ente r a server name...", _
"Connect to the Echo Service", Winsock1.Remote Host)
If temp <"" Then
If Winsock1.State <sckClosed Then Winsock1.Close
Winsock1.Remote Host = temp
Winsock1.Remote Port = EchoPort
Winsock1.LocalP ort = 0
Winsock1.Connec t
End If
End Sub
Private Sub cmdDisconnect_C lick()
If Winsock1.State <sckClosed Then Winsock1.Close
cmdConnect.Enab led = True
cmdConnect.SetF ocus
cmdDisconnect.E nabled = False
End Sub
Private Sub cmdEcho_Click()
Text1.SetFocus
Winsock1.SendDa ta Text1.Text
cmdEcho.Enabled = False
End Sub
Private Sub Winsock1_Close( )
If Winsock1.State <0 Then Winsock1.Close
End Sub
Private Sub Winsock1_Connec t()
Text2.SetFocus
cmdConnect.Enab led = False
cmdEcho.Enabled = True
cmdDisconnect.E nabled = True
End Sub
Private Sub Winsock1_DataAr rival(ByVal bytesTotal As Long)
Dim temp As String
temp = String(bytesTot al, "*")
Winsock1.GetDat a temp, vbString, bytesTotal
Text2.SetFocus
Text2.Text = temp
cmdEcho.Enabled = True
End Sub
Private Sub Winsock1_Error( ByVal Number As Integer, _
Description As String, _
ByVal Scode As Long, _
ByVal Source As String, _
ByVal HelpFile As String, _
ByVal HelpContext As Long, _
CancelDisplay As Boolean)
MsgBox "Error: " & Number & vbTab & Description, vbOKOnly, _
"Winsock Control 1 Error"
CancelDisplay = True
End Sub

Aug 4 '06 #2
Does the Winsock know that the vbstring is unicode?
try one of the unicode convert functions.

(david)

"mike11d11" <mi*******@yaho o.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Actually I haven't even got that far as to send text out, this is just
scrambled data that i'm recieving when I connect. Normally in our
telnet software that came with our host system, when I connect it asked

me for my user name and password, I'm guessing this is what is coming
back accross to me but is unreadable, let me show you my code that i'm
using straight from Microsofts website. Let me know if you can see
where somehting might be incorrect.

Option Explicit
Const EchoPort = 23
Private Sub cmdConnect_Clic k()
Dim temp As String
temp = InputBox$("Ente r a server name...", _
"Connect to the Echo Service", Winsock1.Remote Host)
If temp <"" Then
If Winsock1.State <sckClosed Then Winsock1.Close
Winsock1.Remote Host = temp
Winsock1.Remote Port = EchoPort
Winsock1.LocalP ort = 0
Winsock1.Connec t
End If
End Sub
Private Sub cmdDisconnect_C lick()
If Winsock1.State <sckClosed Then Winsock1.Close
cmdConnect.Enab led = True
cmdConnect.SetF ocus
cmdDisconnect.E nabled = False
End Sub
Private Sub cmdEcho_Click()
Text1.SetFocus
Winsock1.SendDa ta Text1.Text
cmdEcho.Enabled = False
End Sub
Private Sub Winsock1_Close( )
If Winsock1.State <0 Then Winsock1.Close
End Sub
Private Sub Winsock1_Connec t()
Text2.SetFocus
cmdConnect.Enab led = False
cmdEcho.Enabled = True
cmdDisconnect.E nabled = True
End Sub
Private Sub Winsock1_DataAr rival(ByVal bytesTotal As Long)
Dim temp As String
temp = String(bytesTot al, "*")
Winsock1.GetDat a temp, vbString, bytesTotal
Text2.SetFocus
Text2.Text = temp
cmdEcho.Enabled = True
End Sub
Private Sub Winsock1_Error( ByVal Number As Integer, _
Description As String, _
ByVal Scode As Long, _
ByVal Source As String, _
ByVal HelpFile As String, _
ByVal HelpContext As Long, _
CancelDisplay As Boolean)
MsgBox "Error: " & Number & vbTab & Description, vbOKOnly, _
"Winsock Control 1 Error"
CancelDisplay = True
End Sub

Aug 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2090
by: David List | last post by:
I am wondering what I miss to be able to handle binary data from the mysql client. I have ensured that the user has file_priv set to 'Y' and that max_allowed_packet is larger that the binary lumps handled. Here is my version: Ver 4.1.5-gamma-log for pc-linux on i686 (Source distribution) Right now I'm trying this to insert binary data: mysql> update table set col=load_file("/path/file") where id=1;
3
25291
by: Todd Schinell | last post by:
Back in July, Jeffery Tan posted this: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OWOTdf0VDHA.2296%40cpmsftngxa06.phx.gbl In response as to how to get click events from a user control to invoke a method in the parent form. This code doesn't seem to work for me, I've tried it a number of times with very simple test cases (A user control with a single button and a parent form with a single text box) and it always...
0
5570
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control is used to view the state of the running jobs and schedule new jobs. The control also runs in the context of Internet Explorer (we do this so the administrators of the jobs can always receive the latest control). The property grid is used to...
3
2761
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality (we're sales offices, and I'm doing things such as associate directories, commission calculations, order tracking, etc.). 2003 seems to have a few extra features, but I seem to continually run in to oddities that seem like they SHOULD work, but...
4
4953
by: thebjorn | last post by:
I'm working with a MS SQL Server database created by a program from a fine US company who seems to have gotten run over by the Unicode truck. In their infinite wisdom they've decided to store Unicode data directly in regular varchar fields, utf-8 encoded! (on the bright side, it is properly utf-8 encoded). One of our customers then wants to use a csv file created from a report to import in Excel and is getting an attitude when the text...
13
1648
by: trbjr | last post by:
My client-side application works reliably and as intended in Firefox, but not in IE6. The problem seems to be that I do not have control over the page stack in IE, while I do in Firefox. So far I have not figured out how to use “focus” to assure proper page sequencing. Here is an overview of my client-side application. There are 6 screens that capture user-entered data. Screen 1 opens 2, which opens 3, which opens 4, which opens 5, which...
8
11527
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml file. each control has a border with another style, and each border has a unique path inside of it. I need to dynamically add these content controls using c# at runtime and am having trouble referencing the styles and adding the path into the...
6
1886
by: tshad | last post by:
I was looking at a page that showed how to set up a custom event and it seems to work ok. But I am not sure how I would use it. How would I subscribe to it. There is actual action (such as pressing a button or changing text in a textbox). It gets set up and on the user control on my web page I can see the event from intellisense. So it seems to be set up, but I am trying to get an easy example of how I would now use this event. ...
2
5962
by: bhupendrakumar | last post by:
error message System.InvalidOperationException was unhandled Message="Cross-thread operation not valid: Control 'listView2' accessed from a thread other than the thread it was created on." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.Control.get_Handle() at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam) at...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10384
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10395
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7667
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.