HELP - ADO recordset clone failing on SQL Server 7 
Author Message
 HELP - ADO recordset clone failing on SQL Server 7

I am trying to simple clone an ado recordset.

Following code:
 Set adoRst = New ADODB.Recordset
 Set adoRst = objDatalayer.m_adoRst.Clone

The m_adoRSt recordset is opened with:
    If m_adoRst.State <> 0 Then m_adoRst.Close
    m_adoRst.Open m_strSQL, m_adoConnection, adOpenKeyset, adLockPessimistic

This all works in Access 2000 but fails in SQL Server 7.

Why? And how do I get my cloned recordset.

All opinions appreciated.

Ali



Sat, 12 Nov 2005 05:41:57 GMT  
 HELP - ADO recordset clone failing on SQL Server 7
Hi,

What do you mean fails? Do you get any error message?

--
Val Mazur
Microsoft MVP


Quote:
> I am trying to simple clone an ado recordset.

> Following code:
>  Set adoRst = New ADODB.Recordset
>  Set adoRst = objDatalayer.m_adoRst.Clone

> The m_adoRSt recordset is opened with:
>     If m_adoRst.State <> 0 Then m_adoRst.Close
>     m_adoRst.Open m_strSQL, m_adoConnection, adOpenKeyset,
adLockPessimistic

> This all works in Access 2000 but fails in SQL Server 7.

> Why? And how do I get my cloned recordset.

> All opinions appreciated.

> Ali



Sat, 12 Nov 2005 20:22:56 GMT  
 HELP - ADO recordset clone failing on SQL Server 7
I have solved my own question.

The solution is to add the following line:

    m_adoRst.CursorLocation = adUseClient
add this before you open the recordset (master in my case) and clone it.

This makes so much sense now that I see it in retrospect.

Ali



Sun, 13 Nov 2005 00:59:17 GMT  
 HELP - ADO recordset clone failing on SQL Server 7
yes, but this changes the behaviour of the recordset *a lot*. the moment you
open a client-side rs ADO actually fetches the data from the back-end which
might generate *a lot* of traffic.

i though that bookmarkable recorsets are clone-able. surely a server-side
keyset cursor is bookmarkable (in contrast to a server-side dynamic one).

cheers,
</wqw>


Quote:
> I have solved my own question.

> The solution is to add the following line:

>     m_adoRst.CursorLocation = adUseClient
> add this before you open the recordset (master in my case) and clone it.

> This makes so much sense now that I see it in retrospect.

> Ali



Sun, 13 Nov 2005 03:17:18 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help! Disconnected recordsets ADO and SQL Server

2. VB6 - CR7 - SQL Server - Want to send either SQL or ADO recordset to report

3. MS Datagrid - Delete Fails with SQL ADO recordset

4. Cloning ADO Child recordsets

5. ADO Recordset.Clone question

6. Client Side Clone of ado Recordset

7. Copying (not cloning) ADO Recordset.

8. ADO fails to release Recordset cursor after opening disconnected Recordset

9. problem: cloning a disconnected ADO recordset from a class object

10. clone method and SQL server connection

11. Important FYI - Multiple Recordsets w ADO/SQL Server

12. Important FYI - Multiple Recordsets w ADO/SQL Server

 

 
Powered by phpBB® Forum Software