General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only