Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec() returns a maximum of 100 rows
Message
From
11/04/2005 21:36:23
James Chan
Objectmastery Pty Ltd
Hawthorn, Australia
 
 
To
11/04/2005 04:46:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01002489
Message ID:
01003586
Views:
16
CursorSetProp() does the trick. However, CursorSetProp("FetchSize",-1,0) did not return all the rows. Instead I used
>
>CursorSetProp("MaxRecords", -1, 0)
>
and it gives me correct results.

Thanks

>Hi,
>
>There is a set of CURSORSETPROP() commands which can be executed to force the behavior. In your case is
>
>
>CursorSetProp("FetchSize",-1,0)
>
>
>CursorSetProp() function may look as a vicious circle at first glance. One need to set the cursor property before getting the cursor through SQLExec(). General synthax of CursorSetProp() is
>
>
>CURSORSETPROP( cProperty [, eExpression] [,cTableAlias | nWorkArea])
>
>
>If you try to set the property of an inexisting cursor, an error is generated. The trick is to use 0 as nWorkArea. If the function sets the property of work area 0 (which actually does not exist), all future cursors will "inherit" this value. In other words, set the property once and it becomes default. The same trick is true for SQLSetProp(), when you don't have a connection handle yet.
>
>Hope this helps,
>
>>When I issue the following SQLExec(), I got a maximum of 100 rows in MyCursor. What do I need to do to retrieve all rows to MyCursor?
>>
>>SQLResult = sqlexec(h, "select * from MySQLTable", "MyCursor")
>>do while SQLResult == 0
>>  SQLResult = sqlexec(h)
>>enddo
>>
>>
>>Thanks
James Chan
ObjectMastery Pty Ltd
Previous
Reply
Map
View

Click here to load this message in the networking platform