Creating an independent instance of a recordset 
Author Message
 Creating an independent instance of a recordset

I should know what's wrong here but I am having "one of those days".  Excuse
the "newbishness" here.

I have a recordset "rs" which is open and I want to set it to another
variable lets say "rs1". I want to leave "rs1" open so I can manipulate it
independent of "rs", then close "rs" and then change rs.Source, open it back
up as a new/different recordset, set THAT recordset to "rs2", and do it all
again for "rs3", etc. etc. "rs" acts as the temporary recordset inbetween
the others. But I understand that VB really creates a reference to "rs" and
when I change "rs", "rs1", "rs2" and "rs3" will all be the exact same.  So
when I close rs the second time to make "rs2", I also close "rs1".  I think
I am using the keyword NEW appropriately but  it gives me run-time errors.
Please help with a quick rundown on how this should be approached. Thank
you.

-Sid



Sun, 27 Jun 2004 03:00:46 GMT
 Creating an independent instance of a recordset

look into (clone)ing..

I've never gone into it, but I think its what you need,

D.


Quote:
> I should know what's wrong here but I am having "one of those days".
Excuse
> the "newbishness" here.

> I have a recordset "rs" which is open and I want to set it to another
> variable lets say "rs1". I want to leave "rs1" open so I can manipulate it
> independent of "rs", then close "rs" and then change rs.Source, open it
back
> up as a new/different recordset, set THAT recordset to "rs2", and do it
all
> again for "rs3", etc. etc. "rs" acts as the temporary recordset inbetween
> the others. But I understand that VB really creates a reference to "rs"
and
> when I change "rs", "rs1", "rs2" and "rs3" will all be the exact same.  So
> when I close rs the second time to make "rs2", I also close "rs1".  I
think
> I am using the keyword NEW appropriately but  it gives me run-time errors.
> Please help with a quick rundown on how this should be approached. Thank
> you.

> -Sid



Sun, 27 Jun 2004 03:05:36 GMT
 Creating an independent instance of a recordset
Cloneing is the same as making a dependent reference, not an independent
instance. It is just the shorter way of doing things the way I have them
now.


Quote:
> look into (clone)ing..

> I've never gone into it, but I think its what you need,

> D.



> > I should know what's wrong here but I am having "one of those days".
> Excuse
> > the "newbishness" here.

> > I have a recordset "rs" which is open and I want to set it to another
> > variable lets say "rs1". I want to leave "rs1" open so I can manipulate
it
> > independent of "rs", then close "rs" and then change rs.Source, open it
> back
> > up as a new/different recordset, set THAT recordset to "rs2", and do it
> all
> > again for "rs3", etc. etc. "rs" acts as the temporary recordset
inbetween
> > the others. But I understand that VB really creates a reference to "rs"
> and
> > when I change "rs", "rs1", "rs2" and "rs3" will all be the exact same.
So
> > when I close rs the second time to make "rs2", I also close "rs1".  I
> think
> > I am using the keyword NEW appropriately but  it gives me run-time
errors.
> > Please help with a quick rundown on how this should be approached. Thank
> > you.

> > -Sid



Sun, 27 Jun 2004 04:05:04 GMT
 Creating an independent instance of a recordset
Oh, just re-looked up .Clone method and I missed an entire paragraph!! This
is what I want thank you. I researched it earlier and it didn't seem to fit
my bill, I appologize.


Quote:
> Cloneing is the same as making a dependent reference, not an independent
> instance. It is just the shorter way of doing things the way I have them
> now.



> > look into (clone)ing..

> > I've never gone into it, but I think its what you need,

> > D.



> > > I should know what's wrong here but I am having "one of those days".
> > Excuse
> > > the "newbishness" here.

> > > I have a recordset "rs" which is open and I want to set it to another
> > > variable lets say "rs1". I want to leave "rs1" open so I can
manipulate
> it
> > > independent of "rs", then close "rs" and then change rs.Source, open
it
> > back
> > > up as a new/different recordset, set THAT recordset to "rs2", and do
it
> > all
> > > again for "rs3", etc. etc. "rs" acts as the temporary recordset
> inbetween
> > > the others. But I understand that VB really creates a reference to
"rs"
> > and
> > > when I change "rs", "rs1", "rs2" and "rs3" will all be the exact same.
> So
> > > when I close rs the second time to make "rs2", I also close "rs1".  I
> > think
> > > I am using the keyword NEW appropriately but  it gives me run-time
> errors.
> > > Please help with a quick rundown on how this should be approached.
Thank
> > > you.

> > > -Sid



Sun, 27 Jun 2004 04:08:43 GMT
 Creating an independent instance of a recordset
Hi Sid,

You can use the Clone method of ADO recordset. Check its information in
MSDN.

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Mon, 28 Jun 2004 11:26:52 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Creating an independent instance of a recordset

2. Copying existing instance to create a new instance

3. ADO AsyncExecute creates independent connections

4. best dbase for creating independent programs royalty-free?

5. How do I create a recordset from and existing recordset

6. How do I create a recordset based on an existing recordset

7. Create recordset from recordset?

8. How do I create a recordset based on an existing recordset

9. Creating New SHAPE Recordset from Existing Recordset Object??

10. Using a recordset to create another recordset

11. Set Recordset property on a form to a created recordset

12. Creating a new recordset by joining 2 existing recordsets


 
Powered by phpBB® Forum Software