Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO Events ('MoveComplete')

Posted on 2001-07-31
4
Medium Priority
?
537 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 375 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

926 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