473,471 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

comparing two recordsets?

Can someone help me figure out what is the best way to perform this
task?

I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.

For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week

In a language like perl, i would create two hashes, and compare these
hashes by key - but i don't know how to do this in ASP. I only need
to know if they differ in some way - but I don't think just doing a
rowcount is going to suffice.

Thanks for any assistance.

Mar 22 '07 #1
7 3053
da****************@gmail.com wrote:
Can someone help me figure out what is the best way to perform this
task?

I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.

For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week

In a language like perl, i would create two hashes, and compare these
hashes by key - but i don't know how to do this in ASP. I only need
to know if they differ in some way - but I don't think just doing a
rowcount is going to suffice.
Could you provide more details? it could be you are trying to duplicate
functionality that already exists. Is the data in the recordsets from
the same server/database/table?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 22 '07 #2
da****************@gmail.com wrote:
Can someone help me figure out what is the best way to perform this
task?

I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.

For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week

In a language like perl, i would create two hashes, and compare these
hashes by key - but i don't know how to do this in ASP. I only need
to know if they differ in some way - but I don't think just doing a
rowcount is going to suffice.
Oh! And what types of changes are you trying to detect? Added/Deleted
records? Modified data in any of the fields?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 22 '07 #3
On Mar 22, 9:54 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
danielle.m.mann...@gmail.com wrote:
Can someone help me figure out what is the best way to perform this
task?
I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.
For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week
In a language like perl, i would create two hashes, and compare these
hashes by key - but i don't know how to do this in ASP. I only need
to know if they differ in some way - but I don't think just doing a
rowcount is going to suffice.

Oh! And what types of changes are you trying to detect? Added/Deleted
records? Modified data in any of the fields?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.- Hide quoted text -

- Show quoted text -
Thanks for your assistance -

I am trying to detect any changes - an addition, a deletion, or a
modification in the fields. As far as the data being in the database
- it's not. The functionality as it exists is that for a given key, a
"kill and fill" is done with the records in the database. What I have
done is before the "kill" - put the existing records in a recordset.
Then the kill and fill is performed. But I want to compare the
records as they were in the database before the kill with the new
records in the "fill" to see if a "change record" needs to be
written.

I'm trying to not change too much of the existing functionality in
order to accomplish the determination of a change -

Thanks again.

Mar 22 '07 #4
da****************@gmail.com wrote:
On Mar 22, 9:54 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
>danielle.m.mann...@gmail.com wrote:
>>Can someone help me figure out what is the best way to perform this
task?
>>I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.
>>For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week
>>In a language like perl, i would create two hashes, and compare
these hashes by key - but i don't know how to do this in ASP. I
only need to know if they differ in some way - but I don't think
just doing a rowcount is going to suffice.

Oh! And what types of changes are you trying to detect? Added/Deleted
records? Modified data in any of the fields?

Thanks for your assistance -

I am trying to detect any changes - an addition, a deletion, or a
modification in the fields. As far as the data being in the database
- it's not. The functionality as it exists is that for a given key, a
"kill and fill" is done with the records in the database. What I have
done is before the "kill" - put the existing records in a recordset.
Then the kill and fill is performed. But I want to compare the
records as they were in the database before the kill with the new
records in the "fill" to see if a "change record" needs to be
written.
And what if the data in the database changes while you are doing this
comparison?
I really don't like this approach. Too much reliance on cursors and not
enough on transaction processing. What database are you using? If SQL
Server, then you should definitely be using a trigger to generate your
"change record".
>
I'm trying to not change too much of the existing functionality in
order to accomplish the determination of a change -

Thanks again.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 22 '07 #5
On Mar 22, 10:43 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
danielle.m.mann...@gmail.com wrote:
On Mar 22, 9:54 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
danielle.m.mann...@gmail.com wrote:
Can someone help me figure out what is the best way to perform this
task?
>I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.
>For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week
>In a language like perl, i would create two hashes, and compare
these hashes by key - but i don't know how to do this in ASP. I
only need to know if they differ in some way - but I don't think
just doing a rowcount is going to suffice.
Oh! And what types of changes are you trying to detect? Added/Deleted
records? Modified data in any of the fields?
Thanks for your assistance -
I am trying to detect any changes - an addition, a deletion, or a
modification in the fields. As far as the data being in the database
- it's not. The functionality as it exists is that for a given key, a
"kill and fill" is done with the records in the database. What I have
done is before the "kill" - put the existing records in a recordset.
Then the kill and fill is performed. But I want to compare the
records as they were in the database before the kill with the new
records in the "fill" to see if a "change record" needs to be
written.

And what if the data in the database changes while you are doing this
comparison?
I really don't like this approach. Too much reliance on cursors and not
enough on transaction processing. What database are you using? If SQL
Server, then you should definitely be using a trigger to generate your
"change record".
I'm trying to not change too much of the existing functionality in
order to accomplish the determination of a change -
Thanks again.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.- Hide quoted text -

- Show quoted text -
I don't like the approach either - but I am guaranteed that the data
won't change in the database because it is on a per user basis - so,
unless two people are logged in as the same user -there can't be any
changes underneath.

This is SQL Server. Triggers (for this business) are not desireable
due to their maintainability.

I think i am being too unclear - I am really just looking for syntax
for a looping mechanism. For example -
if I have

key 1
key 2
key 3

in the first set and
key 1
key 2
key 3

in the second set - how can i compare the datas key / value pairs?

As I mentioned - this is something I would do using a foreach & a hash
in perl . I am just not familiar enough with Classic ASPs constructs
to know what is the proper mechanism.

Mar 22 '07 #6
hard to do this with ASP. I suggest posting in an SQL server forum. I think you'll find solutions for this type of problem using
some sort of stored procedure...

microsoft.public.sqlserver.programming


<da****************@gmail.comwrote in message news:11**********************@y66g2000hsf.googlegr oups.com...
Can someone help me figure out what is the best way to perform this
task?

I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.

For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week

In a language like perl, i would create two hashes, and compare these
hashes by key - but i don't know how to do this in ASP. I only need
to know if they differ in some way - but I don't think just doing a
rowcount is going to suffice.

Thanks for any assistance.

Mar 22 '07 #7

<da****************@gmail.comwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
On Mar 22, 10:43 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
>danielle.m.mann...@gmail.com wrote:
On Mar 22, 9:54 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
danielle.m.mann...@gmail.com wrote:
Can someone help me figure out what is the best way to perform this
task?
>>I have to detect if there were any changes from one recordset to
another. My recordset consists of a key (guid), and then three
fields. There will probably only be three or four records in each
set, so i'm not going to be dealing with a ton of processing.
>>For Example:
oRS - recordsetname
oRS("EmpKey") - my guid for the record
oRS("Name") - name of the employee
oRS("Salary") - salary of the employee
oRS("Hours") - hours the employee worked this week
>>In a language like perl, i would create two hashes, and compare
these hashes by key - but i don't know how to do this in ASP. I
only need to know if they differ in some way - but I don't think
just doing a rowcount is going to suffice.
>Oh! And what types of changes are you trying to detect? Added/Deleted
records? Modified data in any of the fields?
Thanks for your assistance -
I am trying to detect any changes - an addition, a deletion, or a
modification in the fields. As far as the data being in the database
- it's not. The functionality as it exists is that for a given key, a
"kill and fill" is done with the records in the database. What I have
done is before the "kill" - put the existing records in a recordset.
Then the kill and fill is performed. But I want to compare the
records as they were in the database before the kill with the new
records in the "fill" to see if a "change record" needs to be
written.

And what if the data in the database changes while you are doing this
comparison?
I really don't like this approach. Too much reliance on cursors and not
enough on transaction processing. What database are you using? If SQL
Server, then you should definitely be using a trigger to generate your
"change record".
I'm trying to not change too much of the existing functionality in
order to accomplish the determination of a change -
Thanks again.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.- Hide quoted text -

- Show quoted text -

I don't like the approach either - but I am guaranteed that the data
won't change in the database because it is on a per user basis - so,
unless two people are logged in as the same user -there can't be any
changes underneath.

This is SQL Server. Triggers (for this business) are not desireable
due to their maintainability.

I think i am being too unclear - I am really just looking for syntax
for a looping mechanism. For example -
if I have

key 1
key 2
key 3

in the first set and
key 1
key 2
key 3

in the second set - how can i compare the datas key / value pairs?

As I mentioned - this is something I would do using a foreach & a hash
in perl . I am just not familiar enough with Classic ASPs constructs
to know what is the proper mechanism.
http://www.w3schools.com/vbscript/vbscript_looping.asp

--
Mike Brind
Mar 22 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steve Jorgensen | last post by:
I keep having problems in which ADO disconnected recordset work under some circumstances, but lose all their data at other times, having no rows or fields, though the recordset object still exists....
2
by: Pieter Linden | last post by:
The answer to this one is probably "test it yourself and find out!", but I'll ask anyway. Pursuant to my previous question - sending separate recordsets to Word using the CreateTableFromRecordset...
1
by: lakshmi | last post by:
Hi all, I recently rewrote a data intensive C++ program in C#. The C++ program was traversing 3 recordsets that were all open at the same time. I replaced those 3 recordsets with 3 .NET data...
16
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and...
24
by: Donald Grove | last post by:
I want to populate an array with values from an ado recordset (multiple rows) I use the absolute position of the cursor in the recordset to define the row of my array to be populated. I have a...
4
by: mrmagoo | last post by:
I'm building a vb.net Forms project that is getting data from a SQL Server database. One of the main goals of the project is to be really responsive to events, such as textbox change events. I...
4
by: rdemyan via AccessMonster.com | last post by:
Can someone help me with creating code that will look for DAO recordsets in modules and then check to see if the recordset is also closed in the module. All of my recordsets are of the form rs*...
5
by: JasonP | last post by:
I am using Access 2003 on Windows XP. I am looking to analyse web traffic files using this - I appreciate there are bespoke applications which will do the same task. Each month there are roughly...
4
by: gillianbrooks91 | last post by:
Forgive me for asking this question, I've trawled through nearly every available post on this subject that I can find for a few weeks now but nothing quite points me in the right direction. I'm...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.