Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


ADO-Remove rows from RS object w/o affecting DB

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,167
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> ADO-Remove rows from RS object w/o affecting DB
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 ADO-Remove rows from RS object w/o affecting DB - 6/14/2001 10:48:41 AM   
  peach24

 

Posts: 7
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
I have a recordset object that returns a long list of records. I loop
through each in my VBScript to remove those that are not
relevant. After I have done this, I display the information. I can
not display the information while I go through the records. How
do I remove rows from a Recordset object without deleting those
rows from the underlying database?
 
 
Post #: 1
 
 Re: ADO-Remove rows from RS object w/o affecting DB - 6/14/2001 10:52:28 AM   
  gold7

 

Posts: 10
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
Disconnect the recordset from the DB.

eg:
dim conn, rec
set conn = server.createobject("adodb.connection")
conn.open "DSN=connection"
set rec = server.createobject("adodb.recordset")
rec.activeconnection = conn
rec.open "select * from table"
rec.activeconnection = nothing
conn.close
set conn = nothing

you now have a recordset that has been populated with the data
from your database, but is no longer connected to it. This way, you
can do all the modifications you want to the recordset, without
affecting the underlying data. If you eventually need to update the
DB with the changes, just set the .activeconnection = conn, then do
rec.update...

that should work for you.

(in reply to peach24)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> ADO-Remove rows from RS object w/o affecting DB Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts