Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Posts
    6

    Unanswered: Counter pointing to last record of a database

    Hi,

    Please help me with code for a counter that points to the last record in a database.

    Thanks in advance

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Quote Originally Posted by leredi
    Hi,

    Please help me with code for a counter that points to the last record in a database.

    Thanks in advance
    This is a null request. The term "last record in a database" is meaningless. So is "the last record in a table." When data is entered into a table in the database, the database engine MAY re-use previously deleted record space. Or, it may not. It decides how the data will be inserted, and where it will be inserted in the table.

    When querying a table in the database, unless you specify a sort order, you are NOT guaranteed to get the data in any specific order at all. In fact, if you run a query without a sort order twice, you aren't guaranteed to get records in same order on subsequent queries, even IF no new records have been added.

    In VB, data is returned in the form of a recordset. You may use the recordset.MoveLast method to position the cursor at the last record in the recordset.

    Ref thie ADO Tutorial at a sister site.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •