[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Getting next record in sql server db

Posted on 2015-02-21
2
Medium Priority
?
110 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.
Suggested Courses

649 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