Board index » delphi » Change Record Set Without Effecting Actual Table

Change Record Set Without Effecting Actual Table

I'm working on a project where I need to be able to make changes to a record
set without the changes getting back to the SQL database.  I'm using Delphi
5 Professional, Microsoft SQL Server 2000, and Diamond ADO.

Here's what I'm trying to do:

1. Using the Query component I'm doing a select on a table.
2. I'm going through the records one by one looking for matching domain
names in the URLs field.  An example URL is
http://www.e{*word*277}.com/thiswebpage.htm.
3. For each domain in a row I'm moving the domain to the end of the record
set and deleting the current record (ie, if row #1 and #2 have the some
domain name I move #2 to the end of the record set)
4. I'm displaying the information.

#3 is a problem because the changes I make are getting back to the actual
table.  I'm trying to prevent more than one URL from each domain from
showing up first in the record set.

Example:

I don't want, but I'm currently stuck with:
http://www.domain1.com/page1.htm
http://www.domain1.com/page2.htm
http://www.domain2.com/page1.htm
http://www.domain2.com/page2.htm
http://www.domain3.com/page1.htm
http://www.domain3.com/page2.htm

all pages at each domain show up first before showing the next domain

I do want:

http://www.domain1.com/page1.htm
http://www.domain2.com/page1.htm
http://www.domain3.com/page1.htm
http://www.domain1.com/page2.htm
http://www.domain2.com/page2.htm
http://www.domain3.com/page2.htm

all domains are shown once until there are no more unique domains and then
it doesn't matter how the rest show up.

Any ideas?

Thanks.

 

Re:Change Record Set Without Effecting Actual Table


Quote
"Greg" <greg...@hotmail.com> wrote in message news:3be19884$1_1@dnews...
> I'm working on a project where I need to be able to make changes to a
record
> set without the changes getting back to the SQL database.  I'm using
Delphi
> 5 Professional, Microsoft SQL Server 2000, and Diamond ADO.

> Here's what I'm trying to do:

> 1. Using the Query component I'm doing a select on a table.
> 2. I'm going through the records one by one looking for matching domain
> names in the URLs field.  An example URL is
> http://www.e{*word*277}.com/thiswebpage.htm.
> 3. For each domain in a row I'm moving the domain to the end of the record
> set and deleting the current record (ie, if row #1 and #2 have the some
> domain name I move #2 to the end of the record set)
> 4. I'm displaying the information.

> #3 is a problem because the changes I make are getting back to the actual
> table.  I'm trying to prevent more than one URL from each domain from
> showing up first in the record set.

Use TClientDataset - attach this to your query component via a Provider
(assumes the Diamond ADO query component is descended from TDataset).

--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
"Some see private enterprise as a predatory target to be shot, others as a
cow to be milked, but few are those who see it as a sturdy horse pulling the
wagon." - Winston Churchill

Other Threads