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.
"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