How Do I convert a ATL rowset into ADO STATIC Recordset ? 
Author Message
 How Do I convert a ATL rowset into ADO STATIC Recordset ?

I have the following code, but no matter what I do, the recordset return to
VB is always forword only.
How do I make the recordset static?
Thanks in advance !

(Assume m_session is DB Session)
 CCommand<CDynamicAccessor, CRowset> CRst;
 hrx=CRst.Create(m_session,OLE2T(sSql));
 hrx=CRst.Open(NULL,NULL,true);

 ADORecordsetConstructionPtr spADORsConst;
 _RecordsetPtr spRs(__uuidof(Recordset));
 spADORsConst = spRs;

 hrx = spRs.CreateInstance(__uuidof(Recordset));
 spRs->CursorType=adOpenStatic;
 spRs->CursorLocation= adUseClient;

 hrx = spRs->QueryInterface(__uuidof(ADORecordsetConstruction), (void
**)&spADORsConst);
 hrx = spADORsConst->put_Rowset((LPUNKNOWN)(CRst.m_spRowset));
 m_session.Close();
 file://hr = spADORsConst->put_Rowset(cmd.m_spRowset);
 *pvRecordset= (IDispatch*)spRs.Detach();

 CRst.Close();



Wed, 20 Aug 2003 03:58:38 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How Do I convert a ATL rowset into ADO STATIC Recordset ?

2. OLEDB RowSet to ADO Recordset conversion

3. ADO Recordset vs. OleDB RowSet

4. Is it possible to return ADO recordset from OLE DB Consumer ROWSET

5. Bookmarks Not Supported in some Static ADO Recordsets?

6. Problem Converting ADO Recordset to XML

7. how to convert a variant to ado recordset?

8. Convert VARIANT * to ADO recordset *

9. Problem Converting ADO Recordset to XML

10. Passing ADO Recordset from ATL DLL to VB

11. How to convert Ole DB Rowset to ADO Recordset?

12. Relation between CRowset (ATL) and Recordset (ADO)

 

 
Powered by phpBB® Forum Software