Winsock Controls and Access 2000

  • Thread starter Jeff via AccessMonster.com
  • Start date
J

Jeff via AccessMonster.com

I'm trying to use winsock controls with Access 2000 but I don't seem to have
Winsock in ActiveX controls. Here is the example I'm trying:

Example 2 - Using the Winsock ActiveX Control with UDP

This example uses the same computer to both send and to receive data. You
create a form with two Winsock controls: one of the controls emulates the
client computer and the other control emulates the server.

1. Create a new blank database named WinsockDemo.mdb, or use the one you
created in the earlier example.

2. Create a new form not based on any table or query in Design view:

Form: UDPForm
--------------------------------
Caption: UDP Form

Command button:
Name: cmdSend
Caption: Send Data
Text box:
Name: Text1
Label Caption: Data Received:
Winsock control:
Name: axWinsockClient
Winsock control:
Name: axWinsockServer

3. On the View menu, click Code.

4. Type the following line in the Declaration section of the form's class
module:Dim wsClient, wsServer As Winsock

5. Type the following procedures. To aid in understanding how the Winsock
control works between client and server, the procedures are listed in the
order in which they will occur: Private Sub Form_Load()
' Set the control objects when the form loads.
Set wsClient = Me!axWinsockClient.Object
Set wsServer = Me!axWinsockServer.Object

' Set the protocol for client and server.
wsClient.Protocol = sckUDPProtocol
wsServer.Protocol = sckUDPProtocol

' Set the host and ports for client and server. Because client
' and server are the same computer in this example, set RemoteHost
' equal to LocalIP.
wsServer.RemoteHost = wsClient.LocalIP
wsServer.RemotePort = 1007
wsClient.Bind 1007
End Sub

Private Sub CmdSend_Click()
' Send a broadcast message from the server.
wsServer.SendData "Hello"
End Sub

Private Sub axWinsockClient_DataArrival(ByVal bytesTotal As Long)
Dim strServerMsg As String

' When a message arrives from the server, display it in a text
' box.
wsClient.GetData strServerMsg, vbString
Me!Text1.Value = strServerMsg
End Sub


6. Save and close the form UDPForm.

7. Open UDPForm in Form view and click the Send Data button. Note that the
text box displays "Hello." Because this is a connectionless transmission, you
do not have to establish a client-server connection.

My problem is that I can't insert the winsock control into the form as per
step 2. Winsock is not listed under my ActiveX Controls. Do I need the
Developer's edition of Access?
 
A

aaron.kempf

dont you need VB6 to use the winsock controls?

i swear; there are like special licensing restrictions on thier use or
something; i can't remember

what are you really trying to do? download HTML?

transfter files via FTP?

there are a couple of ways to do these types of things.

-aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top