Solved

ADO Events ('MoveComplete')

Posted on 2001-07-31
4
525 Views
Last Modified: 2008-02-01
I was wondering if anyone could tell me how to solve this problem.
 
for my college project, for which I am Using VB6, I have set up a few ADO connections from code (i.e. not by selecting the icon in the toolbar).
 
How do I access their events to write code in them particuarly the 'moveComplete' event.
Also am I right in assuming this event executes after record navigation?
 
Thanks
 
Michael
0
Comment
Question by:mgroarty
  • 2
4 Comments
 
LVL 39

Expert Comment

by:appari
ID: 6339134
change your declarations to something like this (form level)

Dim withEvents RS1 as adodb.recordset

then you can access all events connected to recordset object. and MoveComplete event is available with recordset object only not with Connection. and MoveComplete fires after moving the record.

MSDN says

The WillMove method is called before a pending operation changes the current position in the Recordset. The MoveComplete method is called after the current position in the Recordset changes.


0
 
LVL 1

Accepted Solution

by:
shahzad73 earned 125 total points
ID: 6339313
Michael if u want events with the object then u have declare your object with the statement as

Dim WithEvents rec As ADODB.Recordset

Also declare this variable in the General section of the form otherwise u won't be able to see its events if u declare them in any function of the form. now if u access the object drop dowm combobox of the form u will see this object in the list. select this and u will see all events of this object in the other combobox

Shahzad
0
 

Author Comment

by:mgroarty
ID: 6340189
Cheers for the help! Only another 255 probs to fix!!
0
 
LVL 1

Expert Comment

by:shahzad73
ID: 6341317
u welcome

Shahzad
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question