Click to See Complete Forum and Search --> : winsock
visva
Feb 1st, 2005, 02:51 AM
hi,
i have assigned the winsock control,
the client side query disply cannot send the error is
" wrong protocol or connection state for the requested transaction or request"
Private Sub Command1_Click()
Winsock1.RemoteHost = "localhost"
Winsock1.RemotePort = 8085
Winsock1.Connect
Print "connected to server"
End Sub
Private Sub Command2_Click()
sql = Text1.Text
Winsock1.SendData sql
Print "sql has been sent to server"
End Sub
Pino
Feb 1st, 2005, 05:39 AM
hi,
i have assigned the winsock control,
the client side query disply cannot send the error is
" wrong protocol or connection state for the requested transaction or request"
Private Sub Command1_Click()
Winsock1.RemoteHost = "localhost"
Winsock1.RemotePort = 8085
Winsock1.Connect
Print "connected to server"
End Sub
Private Sub Command2_Click()
sql = Text1.Text
Winsock1.SendData sql
Print "sql has been sent to server"
End Sub
Hey there welcome to the forums,
This is our codebank and is used for posting code snippets etc,
You may get a faster reply if you post in our general forum or in the case of your question in our Distributed Computing (multi-tier development) forum.
Ok to your question,
That error happens because you are not conneted :)
Print "connected to server" at this point your are not connected to the server but connecting.
Are you running a server application as well?
chonla
Mar 2nd, 2005, 08:55 PM
Try to close your winsock before Connect.
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.RemoteHost = "lolcalhost"
Winsock1.RemotePort = 8085
Winsock1.Connect
Print "connected to server"
hi,
i have assigned the winsock control,
the client side query disply cannot send the error is
" wrong protocol or connection state for the requested transaction or request"
Private Sub Command1_Click()
Winsock1.RemoteHost = "localhost"
Winsock1.RemotePort = 8085
Winsock1.Connect
Print "connected to server"
End Sub
Private Sub Command2_Click()
sql = Text1.Text
Winsock1.SendData sql
Print "sql has been sent to server"
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.