Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practices in Fetching Recs for a C/S DataEntry Form
Message
De
23/07/2010 07:45:36
 
 
À
23/07/2010 04:16:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MySQL
Divers
Thread ID:
01473556
Message ID:
01473572
Vues:
67
Hi Dennis,

I had to look into the code first, 'cause we did this several years ago...

So first I have to correct myself, as we use both properties. Basically the code looks like this (a bit modified as the now used variables are usually properties of our application object:
	liRecords = 200
	liStatus = 0
	lcCursor = SYS( 2015 )
	lcSqlSelect = [select * from mytable]
	CURSORSETPROP( [FetchAsNeeded] , .T. , 0 )
	IF liRecords > 0
		CURSORSETPROP( [FetchSize] , 200 , 0 )
	ENDIF 
	DO WHILE ! USED( lcCursor ) AND liStatus >= 0 
		liStatus = SQLEXEC( giConnectIDAsync, lcSqlSelect , lcCursor )
	ENDDO
	CURSORSETPROP( [FetchAsNeeded] , .F. , 0 )
>Thomas,
>
>I tried the following:
>
>
>oGrade = NEWOBJECT( 'myCAClass', 'myclasslib' )
>oGrade.FetchSize = 50
>oGrade.DataSource = gnDatasoure  && valid connection handle
>oGrade.CursorFill()
>
>
>it returned the whole 70,000 rows!
>
>What did I do wrong?
>
>Thanks again.
>Dennis
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform