Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Practices in Fetching Recs for a C/S DataEntry Form
Message
From
23/07/2010 07:45:36
 
 
To
23/07/2010 04:16:05
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MySQL
Miscellaneous
Thread ID:
01473556
Message ID:
01473572
Views:
66
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform