Solved

Getting next record in sql server db

Posted on 2015-02-21
2
97 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
2 Comments
 
LVL 32

Accepted Solution

by:
Stefan Hoffmann earned 500 total points
Comment Utility
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
Comment Utility
Thanks.  I think I got it figured out.  I appreciate the help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now