Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to run db events outside
Message
From
08/04/2002 02:39:56
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
 
 
To
05/04/2002 10:23:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00641306
Message ID:
00642044
Views:
26
Hello Doug
It is big honor to me to get replay from famous FOXTALK writer
I had the choice to make lectures at VFP in Sibiria and i sit days and days with your papers on VFP7
It really helped to me.
and I try
to use this ocations may be to get replay on the next my problem
I took sample from eventhandler function ad tryed to change it in the following way, that
ado navigation takes place on the form
Public oEvents
Public oRS As adodb.recordset
Public oConn As adodb.Connection

oEvents = Newobject("myclass")

oConn = Newobject("adodb.connection")

oConn.Provider="MSDASQL"
* Make sure to set the SourceDB property
* below to your TESTDATA location.
oConn.ConnectionString="DSN=Visual FoxPro Database;" + ;
"SourceType=DBC; SourceDB=D:\Program Files\Microsoft Visual FoxPro 7\Samples\Data\testdata.dbc"
oConn.Open
oRS = oConn.Execute("select * from customer")

= Eventhandler (oRS, oEvents, .T.)

Do Form nav

Define Class myclass As Session

Implements RecordsetEvents In "adodb.recordset"

Procedure Recordsetevents_WillChangeField(cFields As Number @, Fields As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT

If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Procedure Recordsetevents_FieldChangeComplete(cFields As Number @, Fields As VARIANT @, pError As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif
Procedure Recordsetevents_WillChangeRecord(adReason As VARIANT @, cRecords As Number @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
?1
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Procedure Recordsetevents_RecordChangeComplete(adReason As VARIANT @, cRecords As Number @, pError As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Procedure Recordsetevents_WillChangeRecordset(adReason As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
*!* ?adReason,adStatus,pRecordset.recordcount
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Procedure Recordsetevents_RecordsetChangeComplete(adReason As VARIANT @, pError As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Procedure Recordsetevents_WillMove(adReason As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
?2
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif
Procedure Recordsetevents_MoveComplete(adReason As VARIANT @, pError As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
?1
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif
Procedure Recordsetevents_EndOfRecordset(fMoreData As LOGICAL @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif
Procedure Recordsetevents_FetchProgress(Progress As Number @, MaxProgress As Number @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif
Procedure Recordsetevents_FetchComplete(pError As VARIANT @, adStatus As VARIANT @, pRecordset As VARIANT @) As VARIANT
*!* ? " "+Program() + ' ' + Transform(Datetime())
If Type('_Screen.ActiveForm')='O'
_Screen.ActiveForm.text1.Value= " "+Program() + ' ' + Transform(Datetime())
Endif

Enddefine


The fom has button with code
ors.movenext and two text fields to show field content and reaction on record set event
It does not work inside form
I mean text1 shows no reaction on navigations
Outside the form , it is OK
I tryed here to put create session object directly on
the form using addobject from class definition, it also did not work
I put it outside the form, like it is in the help text, it did not work, I created
connection on the form, it did not work, I payed with datasessionid, set datasession, it
did not work
Thanks in advance, Vladimir
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Previous
Reply
Map
View

Click here to load this message in the networking platform