Solved

Getting next record in sql server db

Posted on 2015-02-21
2
105 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 33

Accepted Solution

by:
ste5an earned 500 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

829 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