Results 1 to 5 of 5
  1. #1
    graffiti is offline Newest Newbie ever
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    Worthing, south coast of the UK
    Posts
    21

    Newbie. Trying to understand recordsets.

    Hi all.

    Here I am again, but not with a "what have I done wrong" question this time.

    I have googled and read about recordsets, but I'm still unsure about WHAT they are. I find explanations on how to use them but until I know what it is then I don't really comprehend.

    Am I correct if I say that they are a seperate entitiy from the tables and queries? If I declare a recordset, do I just make a link into the data that's a part of a table, sort of like a reference to is memory location, or is it a ghostly glob of data on it's own, to be used as a buffer between queries, tables and other database items?





    Example: A simple database of 1 table. Which is closer...
    • The data in the table is stored in the table's recordset. I then access it by declaring a variable of type recordset? Or
    • I create a recordset then copy the table data into it, effectively making 2 copies of the data, the recordset being a seperate item, not a reference?
    • Something else?
    Any helpful pointers for a thickie please please?
    Last edited by graffiti; 12-22-2011 at 08:47 AM.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    First off - let's start with the word RECORDSET. The simplest explanation would be "a set of records." So, a form, when bound to a table or query, has a recordset. The record source is the table or query and when the form is loaded it has now a recordset (or set of records) that were returned from a query (a table may be used but a query is always what returns the records, even if it is a system one which is used behind the scenes when you have selected a table as the record source).

    Now, a recordset OBJECT, either in ActiveX Data Objects (ADO) or Data Access Objects (DAO) is something different. It is an object which contains the set of records and that you can manipulate and, using code, move back and forth (depending on the options you selected).

    And to answer your other questions - the data is in the table. The recordset object does have a copy of the data from the table in it. And when you move through it, you aren't necessarily going to affect the data in the table UNLESS you make changes and then use RecordsetObjectName.UPDATE.

    As for your second bullet point - you don't copy the table data into it. You assign the source and then when you instantiate the object and then OPEN it, that is when Access populates the data.

    And to further confuse you (hopefully not) you can use a RecordsetClone in code for a form but that one DOES update information without an update required. It is basically a ghost image of the main recordset of the form but allows you to maneuver around to find things and such and then you can use the "bookmarks" of the recordset clone record you have navigated to as the main recordset bookmark which then moves the focus on the form to the record you have set the bookmark for.

    I hope I didn't muddy the waters too much for you and that some of this helped.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Try this http://www.functionx.com/vbaccess/Lesson22.htm

    I see Bob answered while I was typing.

    Great answer Bob!

  4. #4
    graffiti is offline Newest Newbie ever
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    Worthing, south coast of the UK
    Posts
    21
    Good morning.

    I posted that just as I left my office at the end of my day, and I've just gotten back in this morning.

    My thanks to you both. I have just skim read what you have written so far, but I shall take some time to study it properly later today. I'll let you know if I have the Eureka moment or not!

    Mike.

  5. #5
    graffiti is offline Newest Newbie ever
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    Worthing, south coast of the UK
    Posts
    21
    Hi again.

    I've marked this solved as there's no more to gain from here. I've read this and more and I THINK I'm getting it.

    Again, thanks for the help.

    Mike.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-20-2011, 08:41 AM
  2. Problems with Recordsets when items contain quotes.
    By caddcop in forum Programming
    Replies: 6
    Last Post: 05-17-2011, 07:49 AM
  3. DAO.Recordsets - When to close and open
    By jgelpi16 in forum Programming
    Replies: 11
    Last Post: 02-08-2011, 09:16 AM
  4. Counting large ADODB recordsets
    By harpyopsis in forum Programming
    Replies: 3
    Last Post: 10-16-2009, 10:05 AM
  5. Recordsets, add new, DAO and ADO
    By Arca in forum Programming
    Replies: 1
    Last Post: 04-07-2008, 03:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums