Solved

ADO Events ('MoveComplete')

Posted on 2001-07-31
4
513 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
Comment Utility
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
Comment Utility
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
Comment Utility
Cheers for the help! Only another 255 probs to fix!!
0
 
LVL 1

Expert Comment

by:shahzad73
Comment Utility
u welcome

Shahzad
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now