Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning Cursors...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00695065
Message ID:
00695466
Vues:
13
Hi All...

Here is another way to pass data between VFP Com Objects without using ADO or XML. I have been testing performance on a class that I have written and it appears to be faster than ADO - as far as transfering down the wire.
Create Cursor 'cTest' (test_key N(1), test_desc C(10))

For x = 1 to 9
	Insert into 'cTest' (test_key, test_desc) Values (x, 'Desc - ' + Alltrim(Str(x)))
EndFor

o = NULL
o = CreateObject('Session')
o.AddProperty('MyData[1]')

Select 'cTest'
x = 0
Scan
	x = x + 1
	Dimension o.MyData[x]
	Scatter Name o.MyData[x]	
EndScan
Then you would use a Gather Statement to reverse the process or address the data directly like
? o.MyData[1].test_key
? o.MyData[1].test_desc
This would handle multiple records of course. If you only needed to pass 1 record - there would be no need for the array. I have also tried creating a shape by attaching data objects to an array (3 dimension). This allows you to store fewer bytes in the event of a One_To_Many file structure.

Let me know what you think.

Barry Childs
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform