Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Recordset vs Cursor

Posted on 2003-10-28
Medium Priority
Last Modified: 2008-02-01
What's the difference between a recordset and cursor?
Question by:vbtiger
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
  • +1
LVL 50

Expert Comment

ID: 9632992
a recordset may be implemented via a cursor
or someother means

a cursor is a Database object which allows the programmer to step throught the result set
and nake processing decisions based on the rows contained within it...

a recordset  is a result set returned to an external (to the database ) program
which the external program provides the capability to navigate...


have you a specific scenario in mind?
LVL 30

Expert Comment

ID: 9633009
Generally speaking you would use a cursor to scroll through a recordset.

A recordset usually refers to an entire set of rows, ie the result of a select from a table or from the SQL recordset functions. A recordset may have zero, one, or more rows.

A cursor is the is an object you can use to scroll through a recordset, allowing you to access one row at a time.

These words have slightly different meanings depending on whether you are using SQL-DMO, DTS, VB, T-SQL, etc.

You may wish to narrow your question down a bit.

LVL 18

Expert Comment

ID: 9633203
Sounds to me like a homework question!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 9633276
Hi all,

Thanks for the quick response.  Actually,  I will be working on a new system based on VB + SQL Server.  I have only experience in developing applications with VB + Access.  I was reading through some articles on cursors and was wondering what the difference between an ADO recordset and cursor is.

BTW,  I need some info to get me started on SQL server.  Any links/pointers would be much appreciated.  I can increase the points if it is really worth it.

Thanks again!
LVL 18

Assisted Solution

ShogunWade earned 100 total points
ID: 9633344
I retract my comment then.

Basically as mentioned.   The results of a query are a set of records (ie recordset)  if you want to perform itterative operations on a set of records you need a "pointer" into the set. This "pointer" is a cursor and it allows you to navigate through a recordset pointing as a single row at any one time.

There are lots of different types of cursor.   You can for example set up cursors in SQL Server which arent exposed to a client application.  or you can set up a cursor on a client app by doing something like this

dim a as recordset

cursor is not esablished.

a cursor generated on a client app can be client side or server side (this defines who is in charge of managing the pointer position (in a very simplistic sense))

Are you completely new to databases or have u had any SQL experience eg( oracle, sybase, MSAccess (lets pretend its sql), etc.)
LVL 18

Expert Comment

ID: 9633356
oops prev post meant to say

 cursor is now esablished.

as opposed to

cursor is not esablished.

LVL 30

Accepted Solution

nmcdermaid earned 100 total points
ID: 9633361
There is no ADO object called a cursor. Your question is a bit vague, what kind of cursor? I have explained generally the difference between a cursor and a recordset.

You can move through a recordset like a T-SQL cursor in ADO, but there is nothing called a cursor.

When you say Cursor possibly you mean the CursorLocation property? client and server cursors have their own advantages and disadvantages, but it is not something you need to worry about at this early stage.

I assume in Access you used the DAO library to access the DB

To use MS SQL through VB you will most likely be using the ADO library, which is slightly different to the DAO version, but recordsets mean the same thing in both libraries (though the objects are a bit different)

Someone else may be able to recommend a book or link to get you started with developing on SQL, but if you firstly check out the ADO help in VB that is a good start.

LVL 18

Expert Comment

ID: 9633410
There are cursros in ADO!

Without cursors it is not possible to iterate through a recordset!

Cursors in ADO are implemented "behind the scenes"

when you open an ADO recordset you are implicitly establishing a cursor and on closing it you are destroying the cursor.

The existance of a cursor provides you with the ability to perform calls such as


LVL 30

Expert Comment

ID: 9633497
Yes of course a cursor is implemented behind the scenes in ADO but as I said there is no ADO object called a cursor.


Author Comment

ID: 9633573
Hi ShogunWade,

I do have experience in developing applications with Access as backend and am also familiar with Oracle to a certain extent (PL/SQL).
LVL 18

Expert Comment

ID: 9633664
"also familiar with Oracle "

ok SQL Server is pretty sumilar to oracle but there are differences.   for example

in SQL Server you can do:

SELECT 'fred'

which returns a recordset of 1 field with 1 value  'fred'

in oracle

you must do:


There are a numer of other differences but as you will see from above it is prodominently syntactical.    I would suggest scanning through sql books on line (commonly refered to as BOL) there are various simple examples in there as well as documentation.   Also look at the sample database Northwind or Pubs  both illustrate the basics of SQL Server.


Author Comment

ID: 9639212
Thanks guys!

Author Comment

ID: 9639231
From the same site:

When your application retrieves rows of data from SQL Server, it needs a place to store the rowset while it processes the information. An ADO Recordset object encapsulates the data and the operations allowed on that data. The Recordset object uses a cursor as a mechanism to organize the temporary storage. The cursor is similar to a dynamic array stored in memory, and the Recordset object is your interface to that array.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question