Open Emtpy ADO Recordset 
Author Message
 Open Emtpy ADO Recordset

Hi all,

I can open an empty recordset in VB like:

<---------------Start---------------------
Private Function MakeRs() As Recordset
    Dim objRs As ADODB.Recordset
    Set objRs = New ADODB.Recordset
    With objRs.Fields

        .Append "data", adVarChar, 8000, adFldUpdatable
    End With
    Set MakeRs = objRs
End Function
--------------- End --------------------->

Anyone know how to do it in VC++?
thx!

Br,
Rayman



Sun, 06 Mar 2005 18:32:06 GMT  
 Open Emtpy ADO Recordset
Example:
CComPtr<_Recordset> pRs;
hr = CreateRecordset( &pRs );  // Creates a recordset with fields
if ( FAILED( hr ) )
return AtlReportError( CLSID_PageData, CComBSTR( L"Failed to create a
new Recordset" ), IID_IMyInterface, E_FAIL );

pRs->Open( vtMissing, vtMissing, adOpenUnspecified, adLockUnspecified,
adCmdUnspecified );

Quote:

> Hi all,

> I can open an empty recordset in VB like:

> <---------------Start---------------------
> Private Function MakeRs() As Recordset
>     Dim objRs As ADODB.Recordset
>     Set objRs = New ADODB.Recordset
>     With objRs.Fields

>         .Append "data", adVarChar, 8000, adFldUpdatable
>     End With
>     Set MakeRs = objRs
> End Function
> --------------- End --------------------->

> Anyone know how to do it in VC++?
> thx!

> Br,
> Rayman



Mon, 07 Mar 2005 00:12:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Exception thrown when opening ADO recordset

2. How do open Recordset from XML stream object use ADO in VC6

3. creating/open an ADO recordset (error)

4. Setting the Properties of an ADO Recordset before it is opened (VC++)

5. ADO/VC - error in recordset open()

6. Error in opening a recordset in ADO in Visual C++ using MFC OLE

7. ADO Open Recordset Question

8. ADO Open Recordset Question

9. How to open a Recordset using a exist Connection with ADO

10. How to open Recordset from XML stream use Ado in VC6

11. ADO Open Recordset Question

12. How to open a Recordset using a exist Connection with ADO

 

 
Powered by phpBB® Forum Software