?
Solved

Getting next record in sql server db

Posted on 2015-02-21
2
Medium Priority
?
109 Views
Last Modified: 2015-02-21
Lets say I have x records in my recordset.  I write those to an array and "use" those and then more are added.  II don't know how many more were added.  I want to go back to where I left off and grab just the new records.  I did create a marker like this:

iLastRcd = rs.RecordCount

How do I re-open the recordset from there without missing any new records and without grabbing any existing records.

Here is the sql query that I am using:
sql = "SELECT Bib, Chip, Time, Reader, Antenna FROM RawRFID WHERE EventID = " & lEventID

Thank you.
0
Comment
Question by:Bob Schneider
[X]
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
2 Comments
 
LVL 35

Accepted Solution

by:
ste5an earned 2000 total points
ID: 40622972
Please rephrase your question and describe your actual problem.

When you "reopen" a recordset new rows may be added at any position in the recordset. So a simple marker don't work.

The only solution is to store a candidate key of the read records, so that you can skip them in the second run.
0
 

Author Comment

by:Bob Schneider
ID: 40622998
Thanks.  I think I got it figured out.  I appreciate the help.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

770 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