Clone Recordset 
Author Message
 Clone Recordset
Hi,

I'm a newbie and I want to clone my recordset.
When I do this :

Dim rs2 As ADODB.Recordset
Set rs2 = rs.Clone

I've got this error message:
    Object or provider is not capable of performing requested operation.

for sure my rs is a valid open recordset. The clone function doesn't work.
What's the problem ???

Thanx for your help
Fred



Tue, 04 May 2004 05:44:52 GMT
 Clone Recordset


Quote:
> for sure my rs is a valid open recordset. The clone function doesn't work.
> What's the problem ???

That fact that your rs is server-sided and not client-sided?

Stephen Howe



Tue, 04 May 2004 08:00:21 GMT
 Clone Recordset
the rs is client-sided !!!!


Quote:


> > for sure my rs is a valid open recordset. The clone function doesn't
work.
> > What's the problem ???

> That fact that your rs is server-sided and not client-sided?

> Stephen Howe



Tue, 04 May 2004 10:15:05 GMT
 Clone Recordset
Hi,

Stephen is right. Did you check that it has client side,
or you think that it has client side. Even if you set
CursorLocation of recordset to adUseClient it does not
mean that it will be opened on client side. It depends on
how you opened your recordset. If you opened it using
Execute method of Command or Connection object then cursor
location will be switched to server side. To open
recordset on client side you need to do next:

1.If you want to  open it using Execute method of
Connection, then set CursorLocation of CONNECTION to
adUseClient. Then open recordset.

2.Or set CursorLocation of RECORDSET to adUseClient and
use OPEN method to open recordset.

Here is an example of cloning of recordset.

Dim loConnection As ADODB.Connection
Dim loSource As ADODB.Recordset
Dim loClone As ADODB.Recordset

Set loConnection = New ADODB.Connection
loConnection.Open "DSN=Test;Database=pubs3;UID=FRI;PWD=", "
FRI", "RAISON"

Set loSource = New ADODB.Recordset
Set loClone = New ADODB.Recordset

loSource.CursorLocation = adUseClient
loSource.Open "select * from authors", loConnection
Set loClone = loSource.Clone

loSource.Close
loClone.Close
Set loSource = Nothing
Set loClone = Nothing

loConnection.Close
Set loConnection = Nothing

Val

Quote:
>-----Original Message-----
>the rs is client-sided !!!!


message



>> > for sure my rs is a valid open recordset. The clone
function doesn't
>work.
>> > What's the problem ???

>> That fact that your rs is server-sided and not client-
sided?

>> Stephen Howe

>.



Tue, 04 May 2004 20:58:11 GMT
 Clone Recordset
Thank you very much ...
That solves my problem !!!

Best Regards,
Fred


Quote:
> Hi,

> Stephen is right. Did you check that it has client side,
> or you think that it has client side. Even if you set
> CursorLocation of recordset to adUseClient it does not
> mean that it will be opened on client side. It depends on
> how you opened your recordset. If you opened it using
> Execute method of Command or Connection object then cursor
> location will be switched to server side. To open
> recordset on client side you need to do next:

> 1.If you want to  open it using Execute method of
> Connection, then set CursorLocation of CONNECTION to
> adUseClient. Then open recordset.

> 2.Or set CursorLocation of RECORDSET to adUseClient and
> use OPEN method to open recordset.

> Here is an example of cloning of recordset.

> Dim loConnection As ADODB.Connection
> Dim loSource As ADODB.Recordset
> Dim loClone As ADODB.Recordset

> Set loConnection = New ADODB.Connection
> loConnection.Open "DSN=Test;Database=pubs3;UID=FRI;PWD=", "
> FRI", "RAISON"

> Set loSource = New ADODB.Recordset
> Set loClone = New ADODB.Recordset

> loSource.CursorLocation = adUseClient
> loSource.Open "select * from authors", loConnection
> Set loClone = loSource.Clone

> loSource.Close
> loClone.Close
> Set loSource = Nothing
> Set loClone = Nothing

> loConnection.Close
> Set loConnection = Nothing

> Val

> >-----Original Message-----
> >the rs is client-sided !!!!


> message



> >> > for sure my rs is a valid open recordset. The clone
> function doesn't
> >work.
> >> > What's the problem ???

> >> That fact that your rs is server-sided and not client-
> sided?

> >> Stephen Howe

> >.



Wed, 05 May 2004 00:37:14 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Can't clone recordset created from stored procedure

2. Cloned Recordsets

3. Cloning recordsets.

4. 2 problems in Access with VC++: IsFieldNull() and Cloning RecordSets

5. Cloned Recordset lost Filter property

6. Cloning recordset

7. copy / clone recordset

8. Cloned Recordsets

9. Cloned RecordSets

10. Cloning recordsets stored in Shared Property Manager

11. how to set recordset clone to second child level recordset in shape command

12. recordset clone not created


 
Powered by phpBB® Forum Software