If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > CursorLocation in ADO

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-04, 09:26
NonLinear NonLinear is offline
Registered User
 
Join Date: Feb 2004
Posts: 97
CursorLocation in ADO

Hi. Is there somebody to explain to me what is "Cursor" and what is "CursorLocation" and how/why this property can affect the RecordCount property? I wonder for all these because I have created a recordset with .CursrorLocation=adUseServer and .CursorType=adForwardOnly but the .RecordCount did not works (the result is -1). Only if I change the .CursorLocation property to adUseClient the .RecordCount works!Why?
Thanks
Reply With Quote
  #2 (permalink)  
Old 10-18-04, 19:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie, cursor type and cursor location determine how the recordset is build and handled and what machine is responsible for the processing of the recordset.

When you set the location to adUseClient the db server must build the entire recordset and then pass it back to whatever the client is (this may be the same machine). If the recordset is completely built then you can get the correct recordcount property. When you are using adUseServer the recordset is often incomplete. It gets added to as needed so you can't get the recordcount.

The cursor type is along the same sort of line but rather then telling it what handles the cursor it says what type of cursor to use. adForwardOnly means you have a static view of the records and you can't go backwards through the recordset. This means that you can move through the recordset faster but only in one direction. Other cursor types will allow you to do different things but may be slower and the recordset may be larger.

Does that help??

Here is a link the the cursortype page on MSDN and under that the cursorlocaiton page.

http://msdn.microsoft.com/library/de...erty_oledb.asp

http://msdn.microsoft.com/library/de...erty_oledb.asp
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On