Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
OstroSoft Winsock Component
 OstroSoft Forums : OstroSoft Winsock Component
Subject Topic: Vba-Event OnDataArrival Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dracon999
Newbie
Newbie


Joined: 16 June 2010
Online Status: Offline
Posts: 1
Posted: 16 June 2010 at 12:52am | IP Logged Quote dracon999

Hi, i'm trying to integrate a aplication with access 2000 using vba and ostrowinsock dll component. That aplication sends some information in tcp 5300 port. Using the code below i can connect, but nothing happens when the aplication sends data. Its something wrong with the ondataarrival event? I'm asking becouse the mswinsck.ocx, is working just fine.

To test i'm using a existing number, but to distribute i will change to localhost

thanks


Option Compare Database
Dim sPage As String
Dim WithEvents wsTCP As OSWINSCK.Winsock



Private Sub Comando0_Click()

Set wsTCP = CreateObject("OSWINSCK.Winsock") 'cria objeto
wsTCP.CloseWinsock
Me.Texto = wsTCP.State
wsTCP.Connect "172.16.10.46", "5300"
Me.Texto = wsTCP.State


End Sub

Private Sub Comando3_Click()

Me.Texto = wsTCP.State

End Sub



Private Sub Comando4_Click()
wsTCP.CloseWinsock
End Sub


Private Sub wsTCP_OnConnect()
  MsgBox "Conectado"
  Me.Texto = wsTCP.State

End Sub

Private Sub wsTCP_OnDataArrival(ByVal bytesTotal As Long)
    MsgBox "dados recebidos"
  Dim sBuffer As String
  wsTCP.GetData sBuffer
  Me.Texto = sBuffer

End Sub

Back to Top View dracon999's Profile Search for other posts by dracon999
 
igor
Admin Group
Admin Group


Joined: 20 July 2005
Location: United States
Online Status: Offline
Posts: 252
Posted: 22 June 2010 at 4:18pm | IP Logged Quote igor

Could be your firewall/anti-virus, blocking Winsock component from communicating with port 5300
Or your application needs something to trigger data sending. Like CHR(13) + CHR(10) on connect
Back to Top View igor's Profile Search for other posts by igor Visit igor's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.92
Copyright ©2001-2004 Web Wiz Guide