FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO events
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
ADO events
Posted: Tue Sep 05, 2006 05:22 AM

Hi !

It's needful to adopt one event in ADO objects . I found an VFP sample ,
it demonstrate what I want to do :

DEFINE C_VFPCOMCLASS 'vfpcom.comutil'

oVFPCOM = CreateObject(C_VFPCOMCLASS)
oRecordSet = CreateObject('ADODB.RECORDSET')
oRecordSet.CursorType = 3 && adOpenStatic
oRecordSet.LockType = 1 && adLockReadOnly
oRecordSet.Open('SELECT * FROM AUTHORS', + ;
'Provider=sqloledb;Server=MYSQL1;' + ;
'Initial Catalog= pubs;UId=sa;PWD=; ')
oEvents = CreateObject('adoevents')
nError = oVFPCOM.BindEvents(oRecordSet, oEvents)
oRecordSet.MoveNext

DEFINE CLASS adoevents AS Session
PROCEDURE WillMove(adReason, adStatus, pRecordset)
WAIT WINDOW 'Moving one record...' NOWAIT
ENDPROC
ENDDEFINE

The problem is that this example is adapted to VFP COM object . So my
question it will second : can I manage events of recordsets without COM
object ( as in sample ) ? Only with ADO objects ?

If yes , can you show some source how to do that ? It's needful to
recognize movings events on recordset and then to do some things .

Many thanks in adcvance ! With best regards ! Rimantas

Rimantas U.

Continue the discussion