Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO to VFP data using VB
Message
 
 
To
14/01/1999 15:16:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00175753
Message ID:
00176181
Views:
29
Hi Craig...

Going forward, we should probably take this off-line...

Are you sure you dont have the CursorLocation values reversed? client-side cursors have a value of 3 and server-side cursors have a value of 2. All client-side cursors are static (type 3). And, as a result, support all of the navigations methods. Server-side cursors by default, are forward-only (type 0). Recordcount will return -1. If you try the MoveLast method - you will get an error that states the rowset does not support fetching backwards.

Do me a favor, double check what this code returns:

?ors.CursorLocation

if it return 2 - it is a server-side cursor. If it returns 3, it is a client-side cursor. If it is a server-side cursor, then check out the CursorType property. I will bet it is 0 - forward only. If it is a client-side cursor - the cursor type has to be 3 - static.

here is some sample code to try:

oconn = createobject("adodb.connection")
ors = createobject("adodb.recordset")
oconn.open("tastrade") && make sure you have a tastrade DSN....
with ors
.activeconnection = oconn
.source = "select * From customer"
.cursorlocation = 3
.open
endwith

?ors.supports(0x00004000) && checks out if absoluteposition prop is supporte

The last line of code will return .T.


I think you have a server-side cursor - think it is client-side


As far as pros and cons between cleint and server-side cursors....

With Client-side cursors, you can take advantage of the Sort and Filter Properties. Also, you can then take advantage of disconnected/persisted recordsets. You can also take advantage of hierarchical recordsets. Server-side cursors are typically used for Web-based/ASP applications. While server-side cursors have a speed advantage during the initial fetch. Client-side cursor have the speed advantage when it comes to navigating through a recordset...













> 1. Even though the code works, the SUPPORTS property
> returns FALSE for APPROXPOSITION. Doesn't that mean
> that references to ABSOLUTEPOSITION should fail also?
> (They don't - except as in question #2)

>
> 2. The code works only if the CURSORLOCATION is server side.
> If the CURSORLOCATION is client side, MOVELAST,
> MOVEFIRST, ABSOLUTEPOSITION, and any reference to
> RECORDCOUNT fails. Any idea why?
>
> 3. In general, what are the pros and cons of server side versus
> client side cursors?
>
>
Previous
Reply
Map
View

Click here to load this message in the networking platform