473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Socketwrench in Access sample code?

1,271 Expert 1GB
If anyone has available some sample VBA code for Socketwrench in VBA I'd like very much to see it. Specifically I'm interested in knowing how to make an event property setting if I don't have a control on a form.

I have put a Socketwrench control on a form, but I only see event properties for OnUpdated, OnEnter, OnExit, OnGotFocus and OnLostFocus. Those aren't even the events that should be there. I should have
OnAccept
OnCancel
OnConnect
OnDisconnect
OnError
OnProgress
OnRead
OnTimeout
OnTimer
OnWrite

I added another Socketwrench control just to see if I had obviously done it wrong, but I got the same result. What could be wrong?

So, I actually have two questions ... why doesn't my control have the right event properties; and how can I establish event properties without a control on a form.

Jim
Jun 21 '10 #1
6 3047
missinglinq
3,532 Expert 2GB
Not familiar with Socketwrench but I'm guessing that it is an ActiveX Control. These controls typically only expose a few Properties in the Properties Pane, as you've found out, but if you go into the code module for the form and enter the ControlName followed by the Dot operator, or use the left hand dropdown to select the name, the usual Properties will then be available.

I'm confused by your second question; you cannot establish event properties of a control unless you have the control on the form. It doesn't necessarily have to be visible, but it has to exist!

Linq ;0)>
Jun 22 '10 #2
ADezii
8,834 Expert 8TB
@jimatqsi
In the Code Pane, select the Control in the Drop Down Combo Box in the ULC. The associated Events for the Control will now appear in the other Combo.
Jun 22 '10 #3
jimatqsi
1,271 Expert 1GB
Thanks, I did not know that about ActiveX controls.

My second question had to do with creating a control in a class, creating a control without having a form to put a control on.

I tried the Ostrosoft Winsock control and it would let me do that. Unfortunately, it seems to send the data in the wrong format or something because it gets rejected completely by the server even though the same code works with a MSWINSCK control.

So anyway, if I want to set the event handler in code, do I just code SocketWrenchCtl1.OnConnect = "[Event Procedure]", like that; or do I put the actual name of the event handler, i.e. "SocketWrenchCtl1t_OnConnect()"?

I guess I'll go code it to see.

Thanks very much.

Jim
Jun 22 '10 #4
jimatqsi
1,271 Expert 1GB
No, no go ... "the setting you entered isn't valid for this property" whether I set it to
SocketWrenchCtl_OnConnect()
or to
[Event Procedure]
Jun 22 '10 #5
ADezii
8,834 Expert 8TB
@jimatqsi
To the best of my knowledge:
Expand|Select|Wrap|Line Numbers
  1. SocketWrenchCtl1.OnConnect = "[Event Procedure]"
Jun 22 '10 #6
FishVal
2,653 Expert 2GB
Hi, Jim.

I think SocketWrench class could have no OnConnect property at all. Try to declare SocketWrenchCtl_OnConnect() sub, check in Object browser whether it receives any argument.

Regards,

Fish

P.S. In design view you only see events of OLE control itself and those events that object inside control delegates to container. However, those events should be available in VBA window.
Jun 22 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John MacIntyre | last post by:
Hi, Can anybody give me a hint as to how to convert a javascript array into a vbscript array? BTW-it only needs to work in IE5 & 6 Thanks in advance, John MacIntyre VC++ / VB / ASP /...
3
by: Jamil | last post by:
I have a device connected through serial port of my desk top PC running Windows 2000. The device is sending some data as serial stream asynchronously. I need to do the follwings: 1) Open the...
15
by: Alex Vinokur | last post by:
I am looking for any custom allocator sample code for std::vector. Thanks. -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn
1
by: Curious | last post by:
Hi List, Obviously my google-fu is very weak and I can't find a simple sample code for C++ that allows me to simply download the source of a specified web page. I'm looking at downloading the...
2
by: Mark Huebner | last post by:
The following sample code for the lock statement is on page 112 of the O'Reilly book "C# Essentials". Can somebody explain to me why this recursive class definition of LockTest does not cause an...
30
by: Chad Z. Hower aka Kudzu | last post by:
I need to provide a series of demos for an assembly. There are potentialy several dozen of them. None of them are very complex, however maintaining two versions of them will be very maintainance...
8
by: _iycrd | last post by:
Specifically I need to wrap an older Win32 DLL in a managed class. I had this running with VS2003's Managed Extensions, though it required two separate classes. With C++/CLI this was supposed...
1
by: Austen | last post by:
hello, im using microsoft access as my Db. i need a primary key in my table and i have to generate the table in vb code. how to write the statement to create a primary key in a table ? can...
5
by: Will | last post by:
- I know enough ASP and Access to be dangerous :) - I need to put up a data base on our web server with 3 related tables. - They will be accessed by a limited number of people. - Each user will...
0
by: Andrus | last post by:
MSDN Winforms DataGridView VirtualMode with caching sample code DataRetriever loads two pages always to cache thus making 2 database accesses. If datagridview uses one page of data, second page...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.